We know there's a lot of Bajorans who are angry and will attack any Cardassian no matter who.
...And these people won't be the ones who establish businesses aboard the formerly Cardassian space station. So Garak has found the sweet spot: in the middle of Cardassian-haters, but at the calm eye of the storm at the same time.
How long the station remained in anarchy (or potentially iron Bajoran grip) between Cardassian departure and Starfleet arrival, we don't know exactly. There was a Starfleet presence there already before Sisko arrived: the E-D folks were patching up the worst of the damage, and even they were not credited as having been the very first.
What happened immediately after the Cardassian exodus is also unclear. It apparently really happened overnight, without much warning, and the Cardassians who did the leaving were probably divided between those swearing never to return, those who were sure they were going to return in, oh, about six days, eight at most, and then Bajor would have hell to pay - and those very few who saw the whole picture, knew that Cardassian internal politics would prevent a return, and foresaw UFP meddling and the opportunities inherent in Cardassia maintaining a more clandestine or indirect presence.
Garak would probably be quick to recover and take his place in the latter lot...
But it still doesn't answer why the Bajorians themselves would have allowed Garak to stay on the station given their strong negative feelings (at that time) towards Cardassians, and especially in light of the death and carnage that the Cardassians inflicted on the station during their departure. Does Bajor have some type of "squatter right's" that applies to ALL humanoids that would allow anyone
, even an alien member of an opposing occupational force, to take some type of proprietary "ownership" of a shop that is governed under a Bajoran sovereignty? As I speculated before, is it possible that Garak bribed/blackmailed an influential Bajoran official in order to be given permission to stay?