There is a speed limit on the GPS of the game that will prevent you from being able to play the game while driving on the bus, car or any other form of transport that is high speed. If you are driving slowly while stuck in traffic or something, it is possible to play. Poke stops are not affected, if you are quick enough to get to them and collect your reward before you go out of range you will be able to collect the items.
The speed limit seems to be set at around 20kmph. If you are travelling faster than this speed limit your trainer will begin a sprinting animation that will prevent any pokemon from spawning in the area that you are currently in. While this sprinting is happening, nothing is going to spawn in your area.