Let's say your story isn't about an intrepid party of adventures or noble knights on a quest. Let's say your hero is actually an anti-hero. A lying, cheating, stealing, killing scallywag. This murderous rogue is constantly ducking the law. Sometimes he gets away with it, other times his luck runs out and he's thrown in the dungeon. In fact that could make for a great "what are you in for?" story - a bunch of criminals passing time swapping stories about their exploits that eventually led to getting nabbed. Or it could be one lone prisoner, awaiting trial/execution, and reminiscing over his life of crime that led up to this dark end. Run with it.
But before you dive on in, there is some ground work and logistics that you have to figure first. What are the laws that govern society? Is there an established, central judicial system like the US Supreme Court? Is there a process like Parliament/Congress that votes on laws? Do judges and lawyers banter for and against the accused? Do jurors deliver a verdict? Does a supreme taskmaster play judge, jury, and executioner? Is there capital punishment? Servitude? Imprisonment? Torture?
If there are prisons, are they regulated institutions, or complete hellholes? Is prison supposed to rehab convicts or just keep them locked away from mainstream society? Are there chain gangs of forced labor? Are prisoners tossed into dank dungeons, ne'er to be heard from again, where they are forgotten and go slowly mad from isolation? Is there an arena where felons can earn freedom and privileges through public bloodsport? Do the innocent/wrongly accused wander pens with murderers and rapists? Does a certain group make up most of the prison population? Is there any chance for parole or escape? Maybe convicts are given a choice of jail, mutilation, or military service. Is there a 3 strikes law? Is jail a deterrent, or is it a better life than many would have had on the outside? Where are prisons located? How are offenses classified? What is the worst? Most common? Current problem?
All things to think about. Don't try to apply all of them, but definitely consider them before you cast them aside.