It is narrated from Abdullah bin Umar (may Allah be pleased with them both) that he stated: The Messenger of Allah (ﷺ) would perform prayer on his camel during travel, whichever direction its face turned.
Hadith Referenceمسند الإمام الشافعي / كتاب الصلاة / 376
Hadith Takhrijأخرجه البخاري: التقصير، باب الإيماء على الدابة (1096) - ومسلم: صلاة المسافرين، باب جواز صلاة النافلة على الدابة في السفر حيث توجهت (700).