It is narrated from Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) would offer his voluntary prayer in whichever direction his she-camel faced.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2205
It is narrated from Sayyiduna Ibn Umar (may Allah be pleased with them both) that he said: I saw the Messenger of Allah (peace and blessings be upon him) offering prayer seated on a donkey, and it was facing towards Khaybar.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2206
(a) It is narrated from Anas bin Sirin that when Anas bin Malik (may Allah be pleased with him) came from Sham, we went to meet him. I met him at a place called "Ayn al-Tamr". He (may Allah be pleased with him) was offering prayer seated on a donkey, and his face was to the left of the qiblah. I said to him: I see you praying facing other than the qiblah! He said: "Had I not seen the Messenger of Allah (peace and blessings be upon him) doing so, I would never have done so."
(b) And in the hadith of Affan it is that his face was towards that side, and Hammam indicated by gesture: to the left of the qiblah. At the end of this narration it is: "Then I too would not have done so."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2207