Praise be to Allah
Taking over a part of the sidewalk and building on it and annexing it to your shop – so that it becomes part of your property or is dealt with as if it were part of your property – is something that is not permissible. It comes under the heading of taking land wrongfully and unlawfully.
It was narrated that ‘Abdullah ibn ‘Umar (may Allah be pleased with him) said: The Prophet (blessings and peace of Allah be upon him) said: “Whoever takes any land unlawfully will be swallowed up by it on the Day of Resurrection to the depth of seven earths.” Narrated by al-Bukhaari (2454).
With regard to displaying one’s goods on it at the time of sale only, if this is something that is commonly done and is customarily tolerated among people, then there is nothing wrong with it, so long as it will not adversely affect passers-by and shoppers, and not make their space too narrow.
Ibn Qudaamah (may Allah have mercy on him) said:
With regard to streets, roadways and alleyways between buildings, no one has the right to develop that land (such as building on it and other activities by which it would become a person’s property), whether they are wide or narrow, and whether that results in less space for people or not, because this is space that is shared by the Muslims and their interests are connected to it, so it is more akin to their mosques.
It is permissible to benefit from the space by sitting there to buy and sell, in a way that does not cause any annoyance to anyone or harm passers-by, because people in all countries and at all times have approved of people doing that, without denouncing it, and because it is a kind of permissible usage, provided that it does not do any harm. So it is allowed, like passing through.
End quote from al-Mughni (8/161)
And Allah knows best.