You can indeed walk from Niagara Falls, NY, to Niagara Falls, Ontario, in Canada, and many visitors choose to do so. The two cities are separated by the Rainbow Bridge, which pedestrians can use to cross the international border.
Please note, however, that you must have appropriate identification to cross the border on foot. This usually means a passport for citizens of most countries, but the exact requirements can vary. Also, you'll need to pay a small toll to cross the bridge.
Before planning your trip, it's a good idea to check the most recent information about border crossings, as the situation can change.