The Prophet forbade praying in the middle of the road, or defecating there, or urinating.

Sunan Ibn Majah Book 1 Hadith 354

Sunan Ibn Majah

The Book of Purification and its Sunnah 1:354

Salim narrated from his father that:

The Prophet forbade praying in the middle of the road, or defecating there, or urinating.

Grade: Da'if (Darussalam)