In short, yes it is a lot like travel on the road. There are treaty agreements that came from the Chicago Convention on International Civil Aviation in the 1940s which allow quite a substantial freedom of international travel and cross recognition of pilot certificates.
In the USA most routes are open to most pilots, the restrictions are based on the conditions and chosen rules of flight. In an emergency the pilot is legally allowed to do anything needed to address the emergency and get the aircraft on the ground without regard for any routes or other rules, as such I will not mention the emergency exceptions for each separate item and situation.(91.3[b] in an in flight emergency requiring immediate action, the pilot may deviate from any rule of this part to the extent required to meet that emergency)
As you said for driving, the rules of driving may change by country but this applies to all drivers equally, it is mostly the same for pilots.The restrictions for pilot certificates mainly relate to the carry of passengers or cargo for hire not the location or route of flight, similar to the divide between private family car and a taxi or delivery service. Exceptions are the very limited hobby flight categories (ultralights, light-sport, and recreational) but this would be similar to a small moped or Vespa which is not allowed on highways marked above 40mph(60kph).
Flying under visual flight rules generally does not strictly adhere to designated routes. The primary designated routes are federal airways(for the space between) and preferred departure and arrival procedures(near the airport), these routes are actually designed to assist instrument flight rules flight planning and the ATC managing said IFR traffic, however following these routes while VFR is allowed. VFR is literally visual, just look out the window and see where you are traveling. Flying under instrument flight rules will require an instrument rating on your pilot certificate, however the instrument rating applies to both private and commercial certificates.
Certain airports are designated as ports of entry and have customs offices, just like old time marine ports and road border crossings; a port of entry is the first landing after crossing the border, though it may be hundreds of miles from the border. A filed flight plan is recommended to reduce border problems but not strictly required in all cases.(see Chicago convention) A port of entry is open to domestic flights just the same as any other public airport.
There are additional restrictions on the choice of route and airport for regularly scheduled commercial operations, as compared to unscheduled air-taxi and private operations. Also the practical physical limits of the airplane and landing surface; length, width, strength of pavement, climb over local obstacles, etc.
We [USA] have airspace classes A, B, C, D, E, G and "special use". A and B are positive controlled meaning that you must negotiate with ATC for clearance to enter. Most special-use are associated with military training or high security areas, though some are simply alerts or caution areas for other potential hazards such as a large flight school in the area.
- Class A is everything between 18000 feet above sea level to flight level 650 (about 65000 feet depending on barometric pressure) and class A requires instrument flight rules which will require both filing a flight plan and an instrument rating on the pilot's certificate.
- B is used for the busiest airports, every flight in B must talk to ATC and get explicit clearance to enter B, IFR flights get priority. When ATC is very busy VFR flights that are just passing through and not landing within the class B area may be turned away. B generally covers an area up to 30 miles from the primary airport, though it has a complex shelf structure that steps up as you get further from the airport and allows other airspace below and above the shelves.
- Classes C and D are also airport tower controlled but they are smaller than B. C is around secondary international and primary regional size airports, and D is for the least busy airports with a control tower.The main difference is that class C requires a radar transponder with altitude encoding and has a 10 mile radius with one shelf, D has a 4 to 6 mile radius no shelf and no transponder requirement. Both require two way radio acknowledgment from ATC but they do not require explicit permission to enter, planes with no radio can be accommodated if arrangement is made with ATC at least one hour prior.(this is to allow for antique aircraft or flights to repair stations) C, D, and E are controlled but not positive-control airspaces, as such IFR traffic is looked after and kept separated by ATC while VFR traffic just minds its own business for the most part, mainly contacting ATC during landing or for departure. Many D airports are so small they close the tower at night and revert to class E or G pilot-controlled airports.(The Boeing factory airports are all public class D) My local air-force and army-airfield bases are both class D and while I usually just cut through (near my preferred airport and I don't want to take the long way) they do allow some non-military landings with prior permission.
- Class E is controlled enroute space, it is all the area between B, C, and D where ATC support is available. Low level Federal airways are all in class E, VOR "victor routes" are the most common type and usually are from 1200feet above ground to 18000 feet above sea level and 8 miles wide, though there are a few T routes [GPS or inertial navigation]. These routes are designed for IFR but they are not restricted, any VFR pilot can fly on them or in between them, though IFR will fly at 1000ft altitudes[eg 5000, 6000] and VFR will add 500ft[eg 5500, 6500]. E also covers air above FL650, though all airspace above FL450 is considered point to point and there are no designated routes. Most airspace above 1200ft is now E, some places E starts at 700ft or at the surface near some airports.
- G is all the space between where ATC is not available, also known as uncontrolled airspace, mostly found from ground to 1200ft, where ATC does not have radar coverage G can go as high as 14000ft. G has no IFR because there is no ATC, and no designated airways because there is no IFR, the grey middle is a class G airport with an instrument approach, generally the instrument approach requires minimum cloud base/decision height above the G to E boundary. Flight in IMC is allowed in G without an active flight plan, at your own risk.
- Special use airspaces are of several types and can be active only select hours (military training fighters or artillery range) or full time; and they can be only an alert to hazards like heavy student training or moderate military operations; "restricted" during certain hours for heavy military use (though you can still radio the controlling agency and ask them for permission to pass); or fully prohibited.(the only prohibited around here is a ballistic missile submarine base, and it only extends to 2500 feet above the surface)
We also have VFR flight plan filing in the USA, but this is voluntary and not permission to fly. A VFR flight plan is only a statement of intended route and estimated time so that a search can be made if you do not contact the service within 30 minutes of the stated arrival time. Flight plans can be changed in flight or canceled and closed by the pilot over the radio without actually completing the trip as filed. IFR flight plans can also be filed, opened, changed, canceled, and converted to VFR by the pilot while in the air.