All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah and that Muhammad is His slave and Messenger.
If this food is originally lawful, then it cannot be declared unlawful merely because it is sold in unlicensed shops. If we assume that it is impermissible to buy from such shops, then the buyer bears a sin for buying the food from these shops and is obliged to repent to Allaah of that sin. However, this does not mean that this food is deemed unlawful.
It should be noted that if the ruler imposed laws that do not contradict the sharee'ah and serve the best interests of people, it is an obligation to abide by these laws because they are within what is lawful and beneficial. Obedience to the ruler in what is lawful and beneficial is obligatory; Allaah, The Exalted, says (what means): {O you who have believed, obey Allaah and obey the Messenger and those in authority among you...} [Quran 4:59]
Allaah knows best.