The word in is short for in(side). The word on is short for on (board).
Ride in a cab.
Ride on (top) of a cab. <we could do this, but it's probably illegal>
Ride in a bus.
Ride on (board) a bus.
Ride a bicycle.
Ride in a bicycle. <if the bike had a covered carriage seat, like, say one for children>
Ride on a bicycle. <meaning, on the bike seat>
Take a ride on (board) a boat.
Take a ride in a boat.
Fly on (board) a plane.
Fly in(side) a plane.
Note that, we get in(to) a plane, a boat, bus, and a cab. We walk on(to) a plane, a ship, and a bus. We can't walk on(to) a cab or a bike, as there is no walk way; i.e., no board to walk on.
Student or Learner