Party Leader: "Once we get the loot from that last dungeon back to our townhouse in Kilesh, I'd like to go talk to Knight Captain Martet. If we help him out with something here in the city then maybe he'll give us a letter of introduction to the Duchess.
GM: "The Knight Captain is happy to see you. He's got a job that none of his men can handle, because half of them are in lockup! Turns out they've been taking accepting bribes to ignore shipments of Devil's Leaf coming off the docks. Martet is positive he's thoroughly cleaned up the city watch, but somehow the illegal substance is still making its way into the city. He needs you and your compatriots to investigate.
A better GM would have shown, not told. It's not good GMing if you're not doing voices.
Almost by definition, any rule will be broken. Whether that rule be personal, religious, cultural, social, or legal; someone will break it. Because of that, crime is an inescapable part of any civilization. Assuming the laws are just and the PCs are good aligned, criminals make excellent foes for PCs. It also works if the laws are unjust and the PCs evil aligned, but I'll be focusing on the former in this post. Most of the time, the civilization where the PCs make their home will have the same kind of laws and crimes which our own societies typically have.
But what happens when those criminals are able to take advantage of living in a fantasy world; monsters, magic, and all?
Most criminals simply won't have the resources to purchase an extradimensional safehouse of course. Nobody turns to crime because they have piles of money lying around, and they don't normally accumulate piles of money picking pockets and burglarizing homes. There are, however, exceptions. The Duchess whose family has secretly ruled a city's criminal element for generations; the charismatic leader who was born poor but learned how to manipulate others into doing his dirty work; the Illithid who provides a city with vices, then controls it's leaders through blackmail; all of these would have the means to hire a wizard, or to outfit themselves (and their minions) with magical crime-aiding items.
Theoretically, a wealthy city could pay some decently leveled wizard a sum of money to research a Detect Contraband spell. That spell could then be permanently affixed to the city gates. Which would cause anyone walking through the gates with a condom full of cocaine in their large intestine to suddenly start glowing a bright red color. While most cities are unlikely to need a precaution like this, those with active smuggling problems may try it.
Unfortunately for the city watch, any city wealthy enough to have an organized criminal element, probably has an organized criminal element wealthy enough to afford a teleport spell. And short of creating a city-wide ward on teleportation spells, there is no simple fix for this issue. And even a city-wide warding spell would have untold complications. No wizards would want to live in the town, for one thing, which I can only imagine is bad for the economy. Not to mention the fact that the myriad of types of teleportation would require a myriad of (very expensive) warding spells.
I suppose a GM could surround a city with four towers (or six, or eight, or however many he or she feels is necessary) which block any travel other than through the material plane. This would allow teleportation to function within the city, as well as just outside of it, blocking only non-material travel past the city's walls.
Criminal ingenuity wouldn't be foiled by even this elaborate setup, though. While relatively expensive, any crime boss would be able to afford a few Portable Holes. And since anything stored in a portable hole is technically in extradimensional space, it would be undetectable.
Any player tasked with stopping the flow of contraband into a city is either going to need to become very creative, or just try to stab everyone involved until they die.
The most obvious type of illegal commodity is drugs. If drugs socially accepted in the GM's setting, then they probably won't be illegal. Otherwise, though, drugs serve as a useful segue into a criminal underground adventure. And regardless of whether they're legal or not in your game world, they have the potential to be endless amounts of fun. Here are a few a dealer offered to my players in a game a few years back:
Magic Dust Residue collected from the creation of magic items. When inhaled through the nose, causes euphoric effects. Can cause spells to malfunction, but only mildly addictive.
Corpse Motes Are detailed thoroughly in an older post of mine.
Speedy Grease When rubbed on the chest, this causes the character to feel incredibly sharp, and aware. Grants initiative +1, but if anyone startles the character they must succeed on a DC: 15 will save or perceive that person as a danger. Non addictive.
Underskin Crawlers One dose includes four of these gnat-sized bugs. Cutting ones self and allowing the insects to get into the wound gives random shots of adrenalin to the character. Anytime the character makes a strength based check, roll 1d20. On 15 or higher, the character can add a 1d4 bonus to that check. Underskin Crawlers are highly addictive and prolonged usage can cause death.
Mother's Butter A pad of a soft, semisolid substance extracted from subterranean fungus. When placed under the tongue, causes characters to wildly hallucinate. Non addictive.
Sharkskin Happies The skin of a dire shark. When rubbed on the stomach, it causes a number of cuts. Sharkskin Happies are a powerful aphrodisiac. These are highly addictive, but have no ill effects save stomach scars and an increased risk of venereal disease.
Drow Eyes Eyedrops which grant the user darkvision for 3 hours. Often used by criminals for burglary. Addictive if used frequently. Can cause blindness after prolonged exposure.
These are all from old game notes of mine, but it's easy to come up with new ones. The most fun ones are the ones your players might actually take, forcing them to deal with issues like addiction and the consequences of prolonged use.
Brothels, opium dens, gambling dens, speakeasies, or even certain types of religions have often been the subject of government bans throughout history. And whenever a government bans something, criminals will be quick to provide it to those willing to pay the price.
The traditional methods of concealing an establishment like this still work great in D&D. A sliding shelf in the back of a shop; a heavy, barred door; a man who asks for a password through a sliding window in the door which only reveals his eyes? It's charming and flavorful, and is great to include in a game. However, it's also mundane, and this post is about the fantastic.
Enter the extradimensional space. A room or building which exists nowhere in particular, but is none the less real. It is a dimension unto itself, created by a wizard. Every evening the doorkeepers wander the streets, perhaps wearing some subtle symbol to indicate their purpose. If you can tell them the password, they take you somewhere private, and use a magic ring to cause a door to appear in the nearest wall. And once you pass through it, your every pleasure is at your fingertips.
The classic example of fantasy counterfeiting comes from the atrocious, fear-fueled film "Mazes and Monsters." In the final scene, Tom Hanks (who went crazy, and now thinks he lives in a fantasy world) tells his visiting friends that each night he gives a coin to the tavernkeeper's wife (his mom) to pay for his room, and each morning it appears again in his purse.
Terrible as the movie was, this is a pretty killer idea. But what else can we do?
Illusory magic is common in the fantasy worlds of D&D/Pathfinder. Even a novice illusionist could enchant a copper coin to appear to be a gold coin. A more experienced illusionist may even choose to permanently enchant a copper coin, so that when a command word is spoken a temporary gold coin illusion is activated.
Money isn't the only thing which could potentially be counterfeited with illusion either. What about a ring which creates a solid illusion of a small piece of jewelry when the command phrase "Absolutely exquisite!" is uttered. A quick fingered rogue with a knack for blending in with high society could potentially steal the jewelry of every woman in the king's court without anyone realizing anything had been taken.
This post is not exhaustive. "Crime" is a rather broad topic. The crimes above are merely the ones which I felt a player might most commonly encounter when dealing with a criminal element. Of course by far the most common would probably be simple theft and assassination. Those are covered so extensively elsewhere, though, that I thought it would be redundant of me to bother with them.