Take the worst or grimmest and darkest side of society, give them a place where all their sins are given free roam to be expressed, and collect it into a system that can just barely sustain itself and you get the Wretched Hive.
It will be a mostly lawless setting, usually (over) populated by criminals. There may be no actual government in this Wild West or Scavenger World because it is miles or light years away from civilization, and if there is it's probably a Dystopia that's corrupt, incompetent, obstructive or perhaps just uncaring enough to not bother to spread its reach to all corners of society. If this hive has any truly good authorities, expect them to be extremely overworked, incapable of controlling the sky-rocketing crime everywhere, or just too idealistic to survive. An alternative is to have it as a gang-like system ruled by a mob boss, Big Bad or Evil Overlord who allows evil, but only to a certain standard. It could be truly lawless with no authority other than the big stick you carry with you.
Even before it went bankrupt, this was the general misconception of the U.S. City of Detroit, Michigan, in which - as was done in Airplane! and RoboCop - if you referred to a place as "worse than Detroit," you were essentially referring to a place that was horrible, like war zones in Somalia, Afghanistan or Beirut.
The economy is often no better. Public facilities are usually falling apart, and the subways and buses are often full of crooks and junkies. Any schools in this place will almost inevitably be impoverished or sadistic. The roads may be cracked and broken, with a Trashcan Bonfire ever fifty feet or so. Many buildings have been abandoned, to be occupied by vermin, hobos, or criminals. Decent jobs are few and far between. Housing (if you can get it) is unsafe, filthy, and overcrowded. In short, poverty is the norm, not the exception.
This lawless setting is often wonderful for allowing all varieties of creativity, ideas and/or tropes to flow in, be played and interact in interesting ways, and many plot conveniences that the protagonists need to get away with doing active work rather than just handing problems over to the police or running into Fridge Logic when they don't get arrested for taking the law into their own hands, while there are several takes on all sorts of unlawful or devious acts. Gangs, cons, gambling, underground fighting, rampant prostitution, a thriving black market (ranging from one guy with some watches under his coat to a literal market), jaywalking and many more. This can be portrayed as anything from guilty fun, inevitable underbelly of humanity to constant danger. The heroes can always find some misdeed around them to solve and the villains will have little problem finding a safe hideout or Bad-Guy Bar to get together and plot schemes. Compare Tortuga and Gotham to take two recent film examples.
The Wretched Hive has a few Sub Tropes in increasing size:
Bad-Guy Bar A tavern of ill repute where the crooks get together to scheme or get a drink. The tenuous peace is only held together by The Bartender and his Bouncers. Bar room brawls and aggressive drunks optional.
The City Narrows The back alley to the entire town; a small section of a city that has a bad name for a good reason and gets avoided by decent folk with any sense.
Red Light District A street, block, or even complete district of a city devoted to prostitution and other illicit trades.
Outlaw Town A settlement run by criminals, for the benefit of criminals.
Not-So-Safe Harbor A port, harbour or coastal town that has fallen into wretchedness due to the flux of sailors and pirates and the sort of rough entertainment they desire.
Vice City An entire urban sprawl that has fallen to wretchedness including its authorities which provide little sense of escape but also little constraint. Often overlaps with City Noir.
The fictional Thai city of Roanapur from Black Lagoon is regarded as the criminal capital of the world.
The Zaraki region of Soul Society in Bleach. When the Blood Knight comes from there and treats slicing up people and smelling like blood as everyday activities, that's because there's a really bad place. Makes one wonder how Hell would be...
From One Piece, since the World Government only controls one Island there, the second half of the Grand Line, dubbed the "New World" controlled by the Four Pirate Emperors, is rather chaotic.
Mock Town on Jaya is a partial example. While pirates have the run of the town and often fight and kill each other, they tend to leave the townsfolk alone, if only so there are people to buy food and booze from. Also, the fact that pirates spend money like water means that the economy is booming.
Subverted in Princess Mononoke. When seen for the first time, the Ironworks are a bunch of grey roofs and tall smoking chimneys crowded together on a small hill surrounded by heavily barbed barricades inside the rotting stumps of a razed forest. But once Ashitaka gets inside, the steel workers are astonishingly well mannered and cheerful people who hold their equally charming director in very high regard.
Lux in Texhnolyzeis this trope. The parts of the city that aren't in the control of three vicious gangs struggling with each other are in hopeless squalor, and the "normal" populace can easily be more dangerous than the gangsters in those parts.
Crashtown in Yu-Gi-Oh! 5Ds. This was originally founded as a mining town to mine a precious mineral called dyne which is used to build D-Wheels, but was eventually taken over by two criminal gangs, who fought each other over the mining rights, eventually using dueling to conscript members into slave labor. The whole arc shows that there is No Honor Among Thieves when Yusei is used as an Unwitting Pawn for one of the leaders to win the conflict, only for him to be double-crossed by his brother. (At the end, the whole roster of Team Satisfaction comes together to bring the criminal rule to an end, making the conclusion both symbolic and satisfying.
Snowtown in Fell is described as a "feral city" where nearly all infrastructure has fallen apart.
Calia, the so-called "Republic of Desperados" that was founded by escapees from Devil's Island, appears in the Modesty Blaise serial "The Jericho Caper".
Cynosure from Grimjack, where all the dimensions meet. In many dimensions you need to hire a bodyguard/private cop or a whole private army. Or just be a total badass.
Gotham City. Comic writer and editor Dennis O'Neil has described Gotham as "Manhattan below Fourteenth Street on the coldest night in November" — only year-round, and on the scale of a city. (For context, recall what a Crapsack World New York was in the early 1990s, when O'Neil wrote that.)
In the New 52 continuity, Gotham's miserable state is partly due to the influence of the Court of Owls, a secret society that relies on Gotham being a Wretched Hive to maintain their power. They are devoting all of their resources and risking their own secrecy to getting rid of Bruce and his associates because Bruce's work as Batmanand as Bruce Wayne might actually make Gotham a better place.
Even worse was Bludhaven, the focus of Nightwing, a city 30 miles out of Gotham that seemed to pick up all the filth that Gotham was too saturated to hold. Eventually it got nuked during Infinite Crisis.
The Question: Hub City, which can legitimately claim to be worse than Gotham and Bludhaven put together.
Sin City. If the name was no indication, the fact that it was based on the worst parts of Las Vegas, LA, New York, and Chicago should fill you in.
In The Life and Times of Scrooge McDuck the town Dawson evolves into one during the height of the gold fever. The local mounties keep far away from the town, citing that: "There's only twenty of us!" Don Rosa makes a disclaimer in his foreword that the real Dawson City was in fact remarkably peaceful and law-abiding place for a town founded in the Gold Rush thanks to the efforts of the Mounted Police, and that apart from the name the town in the stories is based on its counterpart on the United States' side of the border, Scagway, which in contrast lacked any kind of law enforcement.
Mega-City One from Judge Dredd. One might be able to go so far as to say EVERY Mega-City is one of these.
Lucky Luke: Several Far West towns (notably Fenton Town) that Luke usually brings back to the law.
Faith name-drops the Trope Namer when she and Angel investigate such places, including a demon bar where Harmony is stripping. Faith looks on in envy.
Issue 194 "Cabel and the She Warrior". The planet Netherworld is populated by thieves, murders, sadists, terrorists, arsonists and the infamous Vytronian Slavers.
Issue 208 "Planet of the Dead". The planet Vegas Prime's entire surface was covered in all manner of vice dens and it is home to various criminals both petty and serious. Law enforcement is thin on the ground and murder is commonplace.
Doctor Who Magazine: In "The Cornucopia Caper", the Doctor visits Cornucopia, an entire planet ruled by an alliance of different criminal guilds.
Supervillainess Bomb Queen rules over a city where she has outlawed superheroes and crime is more or less part of daily life.
New Hong Kong, in Buck Godot: Zap Gun for Hire. It has one Law Drone, but since New Hong Kong has no laws, it spends a lot of time meditating up on a tower. New Hong Kong may have only one law ("There shall be no laws on New Hong Kong") but it has a great many customs, and the populace enforce them so effectively that it's actually quite peaceful. In the same sense that Ankh-Mopork is peaceful under the Thieves' Guild. Or as the residents of New Hong Kong put it: "There are no laws here. That doesn't mean that there aren't rules."
Iznogoud: Baghdad, especially from the Tabary era onwards, but already in the Goscinny era. Not only it's governed by the oblivious Caliph and the evil Iznogoud, but Humans Are Bastards in that city, and most citizens are hypocrites who complain all the time about Iznogoud's ruthlessness but are willing to help him for a few bucks, despite knowing the consequences if he's ever successful. In the story mentioned above where Iznogoud becomes the Caliph for a short time by changing bodies with him, after he starts unleashing his tyranny, one guy berates the wizard who helped him, but the latter doesn't seem to regret it.
The planet Garnet, aka Hellhole. So bad that the local Green Lantern, Jack T. Chance, still uses lethal force (just not through the ring since they're programmed to not do that).
The Dark World segments of Dungeon Keeper Ami have a certain vibe that reads like this. Actually played with to some extent- the waylaying, slavery, debauchery, and general amorality aluded to is pretty typical and even expected of the underworlders. Further enforced by the various cults of the Dark Gods. Some of the cities are actually fairly clean, leading to Vice City feel.
Mos Eisley from A New Hope, the trope namer. On a broader scope, the planet Tatooine. It's ruled by the Hutts, a race of gangsters. Every single city — not just Mos Eisley — is shown to be incredibly hostile and filled with criminals. As far as natives go, take your pick. You've got the thieving Jawas or the Always Chaotic Evil Tusken Raiders. Or The Empire. The Trope Namer is oddly inverted in The Star Wars Holiday Special. The Cantina is more Cheers than a wretched hive of scum and villainy.
The new trilogy has the lower levels of Coruscant like this.
And the Expanded Universe has Nar Shaddaa, a moon of it. This is because it orbits Nal Hutta, homeworld of the Hutts.
Escape from New York can qualify as well. Technically, in this film the island of Manhattan is a prison if you observe it from the outside, but if observed from the inside, it's a Wretched Hive. The film was shot in downtown St. Louis, Missouri. and East St. Louis, Illinois. the former of which was a real life wretched hive at the time (the area has since been cleaned up and restored) and the latter still is.
As a way-station for people from all over Europe who hope to escape the Nazis, it has acquired a strong criminal element, whose police force is headed by a self-described "poor corrupt official". Ferrari, the head of all illegal activities in Casablanca, is "a respected man". A pickpocket swipes a man's wallet while warning his mark to look out; "There are vultures, vultures everywhere!"
Rick mentions it would be a bad idea to try conquering New York for this reason. The Germans simply wouldn't stand a chance against the local population.
St. Petersburg in Brother. One of the songs of the movie's soundtrack has line "this city of murderers, the city of thieves and whores". Truth in Television for Ex-USSR during the Nineties.
Spoofed as Sogo the City of Sin in Barbarella. Since it was made in the 1960s for general release, the evil shown on the screen mostly consists of people in weird costumes looking darkly at the protagonists, plus some very mild bondage games.
The New York City of the real world is portrayed this way in Last Action Hero. Two people are shot dead in the middle of a public street, with bystanders visible in the background, and one of the shooters takes the time to shout to the rooftops that he did it and wants to confess. The only reaction is someone yelling at him to shut up.
The setting of Indonesian action flick The Raid is this. It's a rundown apartment controlled by drug lord and populated by drug soldiers.
The title ghetto in City of God — a place controlled by drug gangs where little children murder each other in the streets.
District 9 in the film of the same name is this all over — an alien ghetto of makeshift shacks whose inhabitants are listless, unemployed and often criminal, nominally run by a corrupt multinational but infested with gangsters, and the only authority is backed up by sadistic mercenaries. To get that authentic feel, the movie was filmed in a real-life Johannesburg slum.
The railhead town of Hell on Wheels visited by the Lone Ranger and Tonto in The Lone Ranger.
Los Angeles and presumably all major cities in Elysium.
From Hell paints a grim picture of London around 1900.
Titan, the official setting for the Fighting Fantasy gamebook series, has a couple of these. The most notorious are Port Blacksand, well-known as the City of Thieves, and Khare, called the Cityport of Traps. One is a ramshackle collection of pirates, thieves and murderers who'd slit their mothers' throats for a few copper pieces (if mommy didn't get them first), and the other is a debauched collection of cultists and slavers of every conceivable race, who only manage to live together without killing each other because their city is the only thing resembling civilization in a wild, hellish wasteland.
Ragadorn, main city of the Wildlands in the Lone Wolf series. Vakovar in Magador even more so.
Deadwood: Deadwood itself. Eventually gets a telegraph, employs a sheriff and elects a mayor. Remains a place where the preferred way of getting rid of inconvenient corpses is by feeding them to Mr. Wu's pigs.
Justified: Harlan. Particularly in Season 2 when Doyle Bennett uses his police job to keep his family's crimes covered up and intimidate any opponents.
Masters Of Horror: In the episode "Imprint", the remote island is "only inhabited by demons and whores".
Revolution: All cities are apparently like this now: "If you were smart, you left the city. If you weren't, you died there."
Trailer Park Boys: Sunnyvale trailer park Nova Scotia, a mockumentary about three career criminal conmen, and their kin. This property is supervised by a drunk deranged discharged cop and his dimwitted obese underling. Overrun with feral children who randomly throw bottles at residences, and 3 career criminals who naturally cause hilarious hell during the course of the season which revolves around that seasons "Big Dirty" (career heist).
The Wire: Averted Trope. While the lion's share of the show takes place in neighborhoods where everyone is either a drug dealer or a drug addict, the show takes time out to illustrate there are nice parts of Baltimore. Further, it takes a close and careful look at how such disparate places can be so close together and yet so far apart. Quoth Bubbles, "Thin line 'tween heaven and here."
The Free Zones or "Hamsterdam" on the third season is what happens when you concentrate all West Baltimore crime in one place.
In the Alestorm song "Nancy the Tavern Wench", the titular Nancy's tavern is such a hive.
The song "Night City", by The Sword, is about such a place — a metropolis on the dark side of a tidally-locked planet, ruled by slavers and pirates.
The street in the Space song 'Neighbourhood' is definitely one. It's got an Omnicidal Maniac, an Ax-Crazy vicar and a family of criminals, amongst others.
Mötley Crüe's song "Wild Side" takes place in a Wretched Hive.
Guns N' Roses' song "Welcome to the Jungle" also depicts a Wretched Hive. In fact, the line "You know where you are? You're in the jungle, baby! You're gonna die!" was said by a cab driver to Axl Rose during a trip to visit a friend.
Hell, when it's not all fire and brimstone, is this in some interpretations, like "eternal separation from God". Believers consider this to be terrifying enough.
Sodom, Gomorrah, and Ninevah as portrayed in The Bible. Sodom and Gomorrah were considered so vile that nothing short of divine obliteration was enough to clean them. This trope was actually subverted in the case of Ninevah. God told Jonah to preach the people there to repent, or else the city would be destroyed in three days. The king of Ninevah saw the error of his ways and told his people to mourn in sackcloth and ashes in hopes that they would be spared. God did not destroy the city, much to Jonah's chagrin. The last part of the book of Jonah is God giving Jonah a big "The Reason You Suck" Speech because he would rather see thousands of people die than come to repentance.
Sodom's population has been estimated by some to be between 600 and 1200 at the time of its destruction. And in all the city, not ten righteous men could be found, thus God destroyed it.
In The Bible, after King Solomon's reign, Israel divides itself North and South, and lots of corruption and idolatry take place. And then it goes From Bad to Worse as they got involved in wars with neighboring nations such as the Assyrians.
The fallen space port of Svoboda in Nexus Gate fits the bill. It is controlled by crime syndicates and the playground of criminals of every stripe. Kovolis holds no stake in the port's ground.
Survival of the Fittest has this with Denton, New Jersey. Criminal gangs are everywhere in the city, which is practically run by the most powerful of them instead of by the Mayor himself, as the whole police force is either too corrupt or too inept to do anything. Like any other gangs, they've divided the city up between themselves, and they maintain a tense peace between them, as the bloodshed brought by a gang war is bad for business. Even then, though, shootouts and gang brawls are common, while anyone who sticks their nose in the wrong place turns up dead. This is considered highly unusual in SOTF's world, though, and no other city that has been seen is quite as bad as Denton. This came about as an attempt to justify all the gang members in Pregame, and the city apparently disintegrated into full-scale warfare after v2.
After the events of Extermination in Worm, parts of Brockton Bay have become this. Imagine New Orleans right after Katrina, with super powered criminals and psychos who regularly steal supplies and worse. Then it went From Bad to Worse and the government considers condemning the entire area.
Avatar: The Last Airbender holds a couple of these; the ice spring in the middle of the desert, the bar that Jun the bounty hunter is at, and the lovable port with the pirates. "Who's brave enough to look into this bag?"
The Simpsons—The family visits New York City. According to Homer's flashbacks to his last visit NYC conforms to the trope. Every living thing is corrupt in some way. On his last visit, a random guy steals his coat, a cop steals his wallet, and a pigeon steals the very hotdog he was eating. Right from his mouth. A New York pigeon. Also the teller he was reading claimed that "crime was up eight million percent".
Galaxy Rangers had Tortuna. Nominally controlled by Her Travesty, though the Mooks are receptive to bribes. It's crawling with criminals of every stripe, and any human setting foot there at risk of being handed over to the local torturers to be mashed down for Life Energy. Yup, the heroes end up having to head there almost every other episode.