There aren't specific rules, but there are general principles — each preposition has a particular "feel" to it, which guides the use in particular situations. And of course there are plenty of idiomatic expressions which simply abandon those principles entirely.
For the question at hand, I would suggest the following principles:
- "On" is used when you ride on top of the transport, rather than being enclosed by it (on a bicycle, on a motorcycle, on a scooter).
- "On" is also used when the vehicle is large (large enough to stand up and walk around) (on a bus, on a train, on a ship).
- "In" is used when you are enclosed in a small vehicle (in a car).
Note that this means that for some forms of transport it's possible to use both "in" or "on", depending on the size: I personally would say on a Boeing 747, but in a Cessna, and I might similarly use both "in a boat" and "on a boat" depending on how large/enclosed I felt.
Also note that the above are not by any means strict "Rules of English" — they are based on how I (as a native speaker) perceive I use the prepositions. I'm sure there are exceptions, and I'm sure people will point them out — but this is probably a good rule of thumb at least for common cases.