It is narrated from Sayyiduna Ibn Umar (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) used to make his mount (camel, etc.) a sutrah and pray behind it.
Hadith Referenceسنن دارمي / من كتاب الصللاة / 1450
Hadith Takhrijاس حدیث کی سند صحیح ہے۔ دیکھئے: [بخاري 430، 507] ، [مسلم 502] ، [أبوداؤد 692] ، [ترمذي 352] ، [أبويعلی 2632] ، [صحيح ابن حبان 3378]
Brief Explanation
(Commentary on Hadith 1449)
From this hadith, it is understood that it is permissible to perform prayer using a mount such as a camel, horse, or donkey as a barrier (sutrah), but it is not correct to pray in their enclosures or stables, lest the animal becomes agitated and causes harm to the one praying.