It depends
The Prophet ﷺ advised against sitting on the roads. When the companions said they needed these meeting places, he allowed it – as long as you give the road its rights: lowering your gaze, not bothering anyone, returning greetings and encouraging what is good.
Source: Sahih al-Bukhari 2465 · Sahih Muslim 2121