Practically yes you can live in a city where people practice avoda zara. But you have to follow to the end to know why.
There is a relevant mishna in Avodah Zarah (1:4)
It is permitted to be outside a city that contains avodah zarah. If
there is avodah zarah outside it, inside the city is permitted.
Various halachic authorities disagree how to understand the mishna with Rashi, Raavad and the Shulchan Aruch ruling one can enter a city with idols when no idolatrous festival is being celebrated. The Rambam and the Schach disagree.
R Yirmiyohu Kaganoff explains further (here)
The Mishnah implies that one may not be inside a city that "contains avodah zarah." The question is: What is meant by the clause, a city that contains avodah zarah? This is the subject of a dispute among the early authorities. Most Rishonim (e.g., Rashi, Avodah Zarah 11b; Raavad, to Hilchos Avodah Zarah 9:9) explain that the Mishnah is prohibiting entering a city on a day that there is a big festival in honor of a deity. One may not visit the city that day, because people may think that he is entering the city in order to buy or sell from those observing a holiday. This is prohibited, because his financial dealing with the idolaters may cause them to thank their god for the commerce that was provided, which means that the Jew caused a gentile to worship idols. According to this approach, one may enter a city that contains idols when no festival is being celebrated.
However, the Rambam understands the Mishnah differently, prohibiting entering any city that contains idols (Commentary to Mishna Avodah Zarah 1:4).
You should be aware that it is prohibited to travel intentionally
through any city in which there is a temple of avodah zarah, and it is
certainly prohibited to dwell in such a city. However, we are under
their control and we live in their lands against our will… if this is
the law regarding the city, it is certainly so regarding the temple
building itself. It is almost prohibited for us to see it, and,
certainly, we may not enter it.
The Rambam rules the same in his Mishneh Torah (Hilchos Avodah Zarah 9:9), stating that one may not enter a city that contains an idol.
The Shulchan Aruch (Yoreh Deah 149:1) rules according to the majority opinion, meaning that it is prohibited to enter a city containing a building intended for idol worship only on a day when there is a festival. The Shach, however, appears to disagree, quoting the Rambam’s opinion as normative halachah.
R Binyamin Tabady told me though that, in the language of the Rambam and Shulchan Aruch, a city was a small settlement, unlike our modern cities. As such those who forbid entering a city mean a small place where everyone goes to perform avoda zara but not our modern cities.