Allah’s Apostle used to pray (optional, non-obligatory prayer) while riding on his mount (Rahila) wherever it turned, and whenever he wanted to pray the compulsory prayer he dismounted and prayed facing the Qibla.
YES! You can pray (voluntary prayers) while you’re travelling on a car/bus/animal/train/airplane etc. All you have to do is to make sure that you’re facing the qiblah when you start the prayer. That, too, becomes unnecessary when you’re on an airplane.
Next time you’re on a bus, killing time, try praying a few nawafil instead. :)