All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
It is not permissible for a Muslim to sit at a table where alcohol is served [and all other kinds of intoxicants]. Jaabir narrated that the Prophet said: “Whoever believes in Allah and the Last Day should not sit at a table where intoxicants are served.” [At-Tirmithi and Ahmad]
Therefore, it is not permissible for a Muslim to eat in restaurants where alcohol [and all kinds of intoxicants] or pork are served as this is increasing the number of dissolute people and being pleased by what they do and there are other disadvantages.
However, if you are in necessity of doing so, then this is permissible for you on the condition of not sitting at a table where alcohol and other forbidden items are served, or that one should choose a time when such evil does not exist in those restaurants.
Ibn Qudaamah said: “If one knows that the people who organize the marriage banquet have an evil which he does not see or hear, due to it being in a separate place than the place of food, or that they hide it from him at the time of his presence, then he may attend and eat.” Imam Ahmad has stated this.
As for buying lawful items from these places, then this is lawful but if there are Muslim shops then one should buy from them.
Allah knows best.