This is due to inertia. When the speeding bus stops suddenly, lower part of the body comes to rest while the upper part of the body tends to maintain uniform motion. Hence, the passenger's are thrown forward.
When a bus abruptly starts moving, the passengers tend to slide backward due to inertia, as the passenger's inertia tends to oppose the bus's forward motion. Hence, the passenger tends to fall back when the bus accelerates forward.
A getting passenger getting down from a moving bus, falls in the direction of the motion of the bus. This is because his feet come to rest on touching the ground and the remaining body continues to move due to inertia of motion.
This is because of inertia of motion. The part of our body, which is in contact with the bus, changes the direction of motion. However, the rest of the body tries to move in the same direction as before because of inertia of motion.