The Messenger of Allah ﷺ used to pray upon his mount in whatever direction it faced.
حدثنا يحيى عن سفيان حدثني عبد الله بن دينار سمعت
كان رسول الله ﷺ يصلي على راحلته حيثما توجهت به
Its isnad is sahih. It is an abridgment of 5062, and see 5099.