Wikipedia's article titled Canada–United States border says this:
It is illegal to cross the border outside border controls. Everyone crossing the border must be checked.
There appear to be some exceptions and qualifications:
- The International Peace Garden is a park about 3.65 square miles in area that is bisected by the boundary between North Dakota and Manitoba. Visitors enter the park on a road that has the international boundary moving down the middle of it, and when they leave the park going either north or south, they report to border guards as if entering the country. But within the park everyone can freely cross the border.
- The Haskell Free Library and Opera House has the boundary between Vermont and Quebec running through the building. One enters in Vermont, and moves freely about those parts of the building that are open to the public, including areas in both countries, and then exits in Vermont. This page on their web site says "Visitors from Canada must park their cars on the Church Street side of the building and walk around the building to the main entrance. [ . . . ] It is expected that all visitors will return to their country of origin." Apparently in order to drive into the U.S. they have to stop at a border crossing station, but they can walk around the building and then walk back.
- A small part of an industrial-looking building in Beebe Junction, Quebec is in Vermont, and a big part of its parking lot surrounding the building is in Vermont, and it looks as if lots of trucks going from the east side to the west side of the building drive around the south side, taking them about 50 feet into Vermont over a course of 300 feet or so of roadway and then returning to Quebec while remaining on the plant's grounds. (On Google Maps, see 45.005882 degrees north latitude and 72.144024 degrees west longitude.)
- About a mile west of the library a street called rue Canusa is in Quebec and the north and south sides of the street are lined with single-family residential houses. The houses on the south side of the street are in Vermont. Do people visit their neighbors across the street without going to a border crossing station?
- Similarly, in some places two farmers' houses are fifty feet from each other with the boundary running between them and the nearest official border crossing miles away. It seems incredible that they don't visit each other or otherwise cross the boundary.
- The International Boundary Commission marks the boundary with "monuments" (one of which is depicted below). Sometimes these get repaired or replaced and sometimes a new one gets erected. The workers who measure the location and pour the concrete and otherwise work on construction of the monument would routinely cross the border a few dozen times in the course of a day.
- Similarly if a pipeline or a railroad track or a highway is built that crosses the boundary, the workers might walk back and forth while working.
- A conversation between two hunters in Alberta and a rancher in Montana is described in this question posted by the person who took the picture that I'm also including here, and they could all three have circumambulated this monument without thinking about it, and the conversation probably took place when all three of them were in one country or the other.
Does some law enumerate exceptions or qualifications to the rule about "everyone crossing the border"?