A trope usually seen in RPGs; instead of Bob the Warrior being asked by the villagers to travel to the Evil Tower of Ominousness, eliminate its guard mooks and rescuePrincess Alice, the mooks are in the town, Alice is locked in the city jailhouse, and Bob has to fight his way through the streets and houses to get to her. Logically, however, the town is still a town, so Bob can interact with Apathetic Citizen NPCs and buy things.
Many dungeon towns make use of the Absurdly Spacious Sewer, because most big cities have them in real life, and it's an easy space to throw in some Underground Monkeys without breaking the game's immersion.
Related to Adventure Towns, as both tropes involve the characters having to use their wits or muscles to escape or enter the city, although this trope is generally exclusive to video games.
In some rather large cities, it may actually be explainable as you're wandering around the bad parts of the city and are getting mugged by criminals, or monsters have come into a city (Where people don't bother to fight 'em out, pretty much condemning that part of the town anyways) and pretty much took up residence in the slums.
Contrast Dungeon Shop, where someone has inexplicably decided to open a dry goods store in the middle of the Dark Hall of Anguish and Torment.
Zozo is a town full of thieves, complete with Random Encounters and a Boss Battle while climbing a skyscraper to locate a missing party member (who, just for the record, was not kidnapped by said boss).
Narshe is a proper city, although it also doubles as the entrance to Noob Cave. The opening sequence of the game involves leading an Imperial squad through it (fighting off city guards) to capture an Esper located in its mines. After saving it from Imperial invasion later, you can then walk freely around the city, interact with NPC's and so on. Much later (after The End of the World as We Know It) it becomes abandoned, leaving behind only Random Encounters.
During the Imperial occupation of South Figaro, the player must find a way to get Locke out safely. Aboveground it is still a city (despite the Imperial guards occupying it and blocking off city exits), but the secret passages below it are full of Random Encounters.
The deeper parts of Ozwer's Mansion in Jidoor. Strange creatures took over his house and a demon possessed a prized painting of his.
Bafsk and Fynn in Final Fantasy II. In the latter town, monsters roam the streets, and talking to NPCs initiates battle.
Invoked in Final Fantasy XIII-2: Proto Fal'cie Adam turns the citizenry into Cie'th to attack the protagonists in Academia 400AF.
The final level of Wild ARMs goes partway through the residential area of a space station. You also traverse a destroyed town in Wild ARMs 4, and a TV studio in 5.
Wild AR Ms 1 also has a town (Saint Centour) that becomes infested with monsters. Adlehyde turns into this as well at one point.
The Wild ARMs 5 example is justified, you're (unwillingly) taking part in a TV show that's all about monsters fighting humans (and the episode will get low ratings because you guys won).
Also from the same game, Mythysmere seems close, as at first, while wandering through the "town" portion, you run into monsters, until you fight the bosses in the dungeon portion, then people are in the town part and you don't fight battles there anymore. (But you can still go to the dungeon portion for battles.)
In the Human Noble origin, your own castle becomes the Noob Cave after you talk to everybody.
The Redcliffe village undergoes a Zombie Apocalypse for the duration of "The Attack at Nightfall" quest.
The village of Haven becomes this after you discover a certain altar.
The Capital of Denerim becomes the site of the Final Battle.
Likewise, both Amaranthine and the Vigil's Keep are invaded by the Darkspawn in the endgame of the Expansion PackAwakening, though you can only visit one of them in a single playthrough.
The sequel basically is one big Dungeon Town; fights happen all over the city of Kirkwall all the time, particularly at night.
Fallout 3 makes downtown Washington, D.C. into a multilevel, maze-like dungeon, with mundane locations such as brownstone houses, coffee shops, toy factories, and comic book publishing houses serving as sub-dungeons.
Played with in that downtown Washington, D.C is large enough to have multiple save-havens... including one full-on town (by the standards of the region).
All of Koudelka takes place in an inhabited monastery, although all items are found rather than bought.
Most of the China map in Shadow Hearts.
The wine cellar dungeon and a few locations in France, in Covenant.
One dungeon in From The New World takes place on the streets of Downtown Chicago and a large hotel. Another is set inside a college infiltrated by a Mad Scientist. A Bonus Dungeon is set in a movie studio in Hollywood.
The City in the Sky from The Legend of Zelda: Twilight Princess, is the home of the Oocca. In addition to occassionally seeing Oocca wandering around inside it, there are handy shops near the entrance.
Hyrule Castle Town and Kokiri Forest become this in The Legend of Zelda: Ocarina of Time after becoming adult Link. The forest returns to normal after beating the associated temple.
In Zelda II: The Adventure of Link, the town of Kasuto was abandoned because it was invaded by invisible Moas. Once you get the cross, the Moas become visible, making it possible to explore the area (slightly) more safely.
While the main portion of Wakeport in Mario & Luigi: Dream Team is perfectly peaceful, the ruins sections and the Dream World version of the town count as this trope. It also has the dangerous Hermite Crab enemies on the rooftops, so the main portion itself isn't all safe either.
Flower Fields in Paper Mario 64. While it's not a city in the standard sense, a civilization does exist here. Mario has to go through so much trouble in Flower Fields because its citizens aren't very cooperative. Later on, Shiver City becomes one as well, as Mario has been framed of a murder and isn't allowed to leave the city unless he can clear his name.
In a sense, Toad Town becomes integrated into Shy Guy's Toy Box (gameplay-wise, not physically), the dungeon in Chapter 4, as objects found in the toy box must be returned to their owners around Toad Town to progress.
Glitzville also, as Mario stumbles on a conspiracy taking place there and, as Mario continues to stay in the town, he has to find passages to covertly listen in on things. In addition, as he is in a fighting league during this conspiracy, he gains access to new rooms and locations as he rises up, allowing him to continue following suspicious people.
The Overthere in Super Paper Mario. The Overthere Stair, the path to reach the city, is the longest stage in the game, and once Mario and his allies get to the Overthere, the citizens are in the midst of a war, requiring Mario to fight his way through the place.
Chapter 5 of Super Paper Mario contains two, also: Downtown of Crag and the Floro Caverns. Mario arrives in Downtown of Crag as the Floro Sapiens capture some friendly Cragnons, forcing Mario to make his way through the city. Floro Caverns is the capital city of the Floro Sapiens, and Mario has to get through their rather heavy defenses (for sentient flowers, at least) that seems to permeate the entire civilization.
Phlan from Pool of Radiance is perhaps the best example. The party was hired by the town council to liberate the old parts of the town, now crawling with monsters and thugs.
The Mass Effect series features missions set on Dungeon Planets in all games.
Also true for Taris in Knights of the Old Republic: You run fetch quests, play minigames, go bottomside and kill monsters, get into street fights, etc. And this is just the Noob Cave.
Dwarf Fortresses in, um, Dwarf Fortress. Returning to an abandoned settlement from fortress mode while playing adventure mode leaves you to deal with whatever wiped them out. Armok help you if you run into the Hidden Fun Stuff.
One of the cut features of Quest for Glory II was the notion that if you were in the bad part of town, you could run into random brigands (serving as muggers). They cut it because they decided Shapeir should be a safe territory.
Blue Stinger takes place on a research lab/town set on a solitary island. In between roaming the town and fighting monsters, you can raid stores and malls to use vending machines, which dispense almost everything from food to weapons to armor. Dead Space also uses a similar approach to obtaining gear.
Shin Megami Tensei I's Tokyo. Monsters can be found anywhere (which was a Western RPG tradition of the time that they borrowed), unless something very powerful is guarding the area.
Similarly, demons quickly wind up wandering the streets in the original Persona, which played very similarly to the main SMT series at the time.
Though this one is tipped off from an Interface Spoiler—all the other towns have multiple gates, and the Imperial City even has districts. Kvatch just has a single fast-travel node.
The Imperial City at the end of the main quest.
In The Elder Scrolls V: Skyrim, Helgen, where you first get control of the character, gets attacked by a dragon, forcing you to escape through caves accessed from the Keep. If you return to the ruins of Helgen later on, bandits will have set up camp there.
Lashute, the final dungeon in Phantasy Star III. No shops to patronize, but plenty of Apathetic NPCs declaring how their evil regime will soon rise to triumph.
Romancing SaGa has South Estamir, where you can run into fleet-footed beggar children (who ask for money, then insult you if you refuse) and bandits (who demand all your money, then attack when you refuse). Estamir also uses the Absurdly Spacious Sewer variation.
As does Melvir, which becomes an even straighter example when the city is attacked, forcing the heroes to fight through the sewer and castle to save the king. (They can also take a detour to the dock for an optional boss, if they like — in fact, Hawke's scenario lets the player chase down this boss to finish them off, at the cost of leaving the castle to somebody else.)
Halfway through Ys V: The Lost Desert Kingdom of Kefin, Xandria becomes a dungeon town.
Nox does it with all of its towns across multiple playthroughs (except the Village of Ix): Brin is always a war zone due to the recent Ogre invasion (even after it is repelled, it remains in ruins), while DŁn Mir and Castle Galava are either overrun by the undead the second time you visit them, or populated by the sworn enemies of your character's class from the onset.
Kaineng City in Guild Wars includes several explorable areas, where the enemies are mostly gangsters.
In Champions Online, both the main city of Millenium City (a rebuilt Detroit) and the higher level zone Vibora Bay (a New Orleans expy) are teeming with bad guys - gangsters, robots, VIPER agents and more in the former, and werewolves, vampires, zombies, and fallen angels in the latter, among others. And yet, life goes on for the presumeably level 0 civilians...
Lost City of the Tol'vir involves the player and their party raiding a city full of hostile NPCs.
Dragon Soul, the final raid of Cataclysm, involves Deathwing's and the Old Gods' forces invading Wyrmrest Temple, the headquarters of the Wyrmrest Accord.
The prospective final raid of Mists of Pandaria involves invading Orgrimmar. Whether or not the city is normally a safe haven depends on the player's faction.
Both Traverse Town and Twilight Town in the Kingdom Hearts series have safe places where you can talk to NPCs and buy items but also have numerous areas where enemies will appear to hassle you. Some of the games do away with the safe zones entirely, though.
Either Celeste or the Pit in Might and Magic VII, depending on which side you align with — both cities get unlocked when you align, but the guards (high-level creatures; Celeste has angels and archmages, the Pit has liches and Queens of the Dead) in the city of the opposing side are (naturally) hostile to you. The shops and inns, however, are not.
Gunple: Strange World Gunman's Proof had the City Of The Dead: a ruined village turned maze by fallen debris and underground crawlspaces and crawling with ghosts. It served as the fourth dungeon.
Most of Planescape: Torment is set in the enormous (and enormously weird) city of Sigil, where thugs (and occasionally other things) attack you regularly.
This used to be conventional in Western RPGs, with almost every town being populated by monsters to level-grind against. The Bard's Tale Trilogy and the first five Might and Magic games exemplify this; it's rarer to find an aversion than an example in these games.