Upvote:4
In most cases yes no, since Immigration laws apply mostly only to non citizens, they must check if they apply to each person crossing a border (citizen or non citizen).
Then there are cases when a citizen is not actualy allowed to leave their country in the first place due to certain criminal records.
Since many borders are also a customs border, which applies to everyone, crossing at certain points can also be required for customs checks.
Upvote:18
Contrary to Mark's answer, I would rather assume the opposite and that it in most countries even for the citizens of that country, is illegal to enter the country outside designated border control posts.
Within the Schengen area, borders can of course be crossed everywhere, but crossing an external Schengen border outside designated border control posts (both entering and leaving) is also for EU/EEA citizens prohibited. Even if EU/EEA citizens in most cases can't be refused access to any country in the Schengen area, they are still subject to an immigration check at the border. Crossing the Norwegian-Russian border illegaly is for example usually sanctioned with a roundabout 1000β¬ fine.
I know there are a few local exceptions in very remote areas, but entering the US is just as well only allowed through staffed ports of entry. As CBP points out in the linked article, although it is usually not a violation of US law to leave the US at an arbitrary point, you will at the land borders immediately violate Mexican or Canadian law by doing so since you are only allowed to enter Mexico or Canada through designated ports of entry.