The Messenger of Allah ﷺ used to perform voluntary prayers on his mount, facing whatever direction it happened to be heading, and he would also pray the witr on it, but he would not pray the obligatory prayers while mounted.
و حدثني حرملة بن يحيى أخبرنا ابن وهب أخبرني يونس عن ابن شهاب
كان رسول الله ﷺ يسبح على الراحلة قبل أي وجه توجه ويوتر عليها غير أنه لا يصلي عليها المكتوبة