Arnie has just beaten off a murderous attack by Bob. Plot over, Bob goes to jail, roll credits, right?
Wrong. Maybe Arnie was bigger, or stronger, or could conceivably have run away. Either way, someone in a position of authority feels that Arnie was in the wrong inflicting whatever damage he did to Bob. Bob, on the other hand, is a poor victim. Cue drama.
This often involves Double Standard: Abuse, Female on Male; sometimes, it's due to Selective Enforcement. Compare Can't Get Away With Nuthin', Wounded Gazelle Gambit, Wrongful Accusation Insurance. An attacker may even play a Deliberate Injury Gambit to invoke this trope. A history of such cases In-Universe may explain occurrences of Once is Not Enough. If the attacker uses words instead of violence, it's Made Out to Be a Jerkass.
As with everything else law-related, expect the writers to interpret self-defense laws creatively. Whether this is Truth in Television varies heavily depending on circumstance: self defense laws usually give a person the benefit of the doubt when defending themselves or others against attempted murder, rape, or assault with a deadly weapon. However there are many circumstances in which this presumption goes away, and you can be put in prison for attempted murder for firing a warning shot at an attacker.note Discharging a firearm at someone is always considered use of deadly force, even if you don't intend to hit them... and not intending to hit them is considered evidence you didn't actually fear for your life.
Compare Arrested for Heroism. See also the Sliding Scale of Unavoidable vs. Unforgivable.
No Real Life Examples, Please!. This does happen in the Real Life, especially in European countries which follow the Romano-German jurisprudence. Let's leave it here.
This is the entire conflict between the X-Men and their nemesis, Magneto. The X-Men wholeheartedly believe in this ideal, as taught by their leader, Professor Xavier. Magneto, on the other hand, believes that the only way to battle oppression is to rise up and conquer humans. Various points of media will show either as being "right", Depending on the Writer.
Explicit in Judge Dredd, where vigilante justice is a more heavily enforced crime than burglary and drug dealing. Yes, this includes "lethally resisting someone trying to kill you", or "breaking and entering private properly while trying to escape," but only if you're caught. Hilariously lampshaded when Rob Schneider's character in the first movie is told he didn't have to hijack the food-bot, he could have gone out the window.
Fergee: From twenty stories!? That would be suicide!
In Con Air, the (sympathetic) main character is put in prison for accidentally killing someone in defense of his pregnant wife, because A) one of the three scumbags who was trying to assault him got rid of the knife his late buddy pulled, B) his idiot lawyer advised him to plead guilty, C) the Hanging Judge on the case says that as an inactive soldier with expert combat training, he should have been more careful since his assailants were unarmed — even though there were three of them.
An especially jarring plot point from The Butterfly Effect has Evan get sent to jail when he accidentally kills Tommy in self-defense. Mind you, everyone knows Tommy is a violent psycho and there were a dozen witnesses to testify that Tommy was trying to kill Evan.
In Escape from Alcatraz, English is a veteran inmate in Alcatraz prison in 1960. He tells Frank Morris his story how he wound up in there. He was harassed by two men, who tried to attack him with knives. English killed them both. The reason why he got two 99-year sentences, back-to-back? The two men were white, and he was black.
In The Dirty Dozen, African-American soldier Robert Jeffersen was sentenced to death by military tribunal for killing two white racists who were trying to castrate him.
In Harry Potter and the Order of the Phoenix, Harry risks breaking The Masquerade by using magic to protect his cousin and himself against Dementors, and is put on trial for this. In this case, the government in question is waging a propaganda war against Harry, and is twisting the law in order to punish him as much as possible and make him look like a delinquent. And then it turns out that one of their particularly nasty members is secretly responsible for the attack in the first place.
In Hoot, Roy punches Dana in the face while being choked and is subsequently punished.
Honor Harrington takes some flak with her political opponents for shooting a man when she knew his gun was empty, because he had emptied it in her general direction when her back was turned, in direct violation of the rules of the duel the two were engaged in. Under those rules, the supervisor was required to kill the offending party (which he was just about to do when she beat him to the punch), so her opponent would have died anyway.
Season two of Dexter has his girlfriend's abusive ex-husband force his way into her house. Her children are sleeping nearby, and she's afraid of what will happen to them if she puts up a fight, so she lures him into her bedroom, and smacks him down with the Emergency Bat she keeps under her bed. Next thing you know, the ex-husband is filing assault charges against her, and she's in danger of losing her kids. Fortunately, her current boyfriend just happens to be a Serial-Killer Killer...
In the Star Trek: Enterprise episode "Lone Star", killing a human, even in self-defense, is a hanging crime for a Skagerran.
Space: Above and Beyond: Cooper is beaten and nearly hung in an alleyway because he was an Artificial Human. When he throws himself on a police car begging for help, they arrest him and shoo his attackers off. The judge sentences him to a stint in the Marine Corps, which turns out to be a huge improvement compared to his previous lot in life as a homeless person, even with an intestellar war raging.
Bob Marley "I Shot The Sheriff" (but he did not shoot the deputy).
The iOS Choose Your Own Adventure called Heroes Rise has the Player Character's parents be famous superheroes who were attacked by an assassin while accepting their award in public. While attempting to subdue her, they accidentally kill her. The judge sentences them both to life in prison with no possibility of parole and doesn't even grant them visitation rights. Oh, and all their money is given to the assassin's daughter. It's made clear that this was a political move on the judge's part, as he was running for mayor at the time. However, it's not clear why a murder trial wasn't a trial by jury and why the jury didn't side with the city's favorite superheroes instead of an assassin who was trying to kill them. There should've been an appeal to a higher court (i.e. where said judge couldn't do anything). On the other hand, the ending implies that the judge-turned-mayor may have had other reasons to put away the player's parents.
Generally, in video games where combat is not consistently necessary, typically in a Wide Open Sandbox with police patrolling throughout the game-world, if they're not programmed to go after the player for everything they will react to witnessing violence by assuming the first person they see holding a weapon or otherwise attacking someone is responsible for it and begin trying to arrest/neutralize them. If the player isn't careful this typically results in the police joining random aggressive NPCs in attempting to kill the player for little reason, but if they are careful they can exploit this to remove those troublesome NPCs by attacking them once and then luring them towards the police.
In GTA, it's worse - the gangs can use you for target practice and the police isn't the least interested. But just kill one of those lil' Ballas vermins...
There's a subversion in Danganronpa: The first culprit killed someone who tried to kill him first, making it a crime of self-defense...except as a classmate points out, the first culprit actually had another option; when the would-be murderer locked herself in the shower, the actual murderer could have simply left the room and escaped. Instead, he went out of his way to retrieve his toolbox from his room, then go back to his victim's room just to break down the shower door and stab her.
This is only to be expected throughout the Ace Attorney series, given the state of the court system. It doesn't matter how desperate or how much in danger the defendant might have been, if it looks like they were responsible at all for the death of the victim, they'll be sent to prison.
For example, Case 1-4 has Edgeworth nearly found guilty for the killing of his father, even though he had no idea the gun would have gone off (he didn't know the safety had come off), he was oxygen deprived when he acted, he was nine years old at the time, and he hadn't even shot the gun (he threw it at Yanni Yogi, to stop him from attacking his father). Granted, the prosecution had reasons to push for Edgeworth to get the maximum penalty, but the Judge seems just as inclined to agree that he deserves to be prosecuted to the fullest extent of the law.
This reaches dizzying extremes in Rise from the Ashes, when Ema Skye was believed to have accidentally killed Neil Marshall when she shoved him while believing him to be the serial killer he was fighting in the dark. Even though she was acting in self defense of both herself and Neil, even though she was a scared kid who wasn't entirely sure what was going on, and even though her actions supposedly killed Neil in a way no one could have predicted (seriously, who would expect a guy shoved by a young girl to somehow fly in the air and get impaled on a decorative sword?), everyone acted like she really would have been arrested and sent to prison for it. Phoenix has to prove that she had nothing at all to do with Neil's death.
In a strip of Ozy and Millie, their regular Jerk Jock bully, Jeremy, keeps pushing Millie into a pool of mud, knocking her over every time she tries to get up. Finally, she snaps and socks him in the face... at which point a teacher immediately spots her, and hauls her into the principal's office for starting a fight. (The injustice inherent in the school system is a frequently visited theme).
What makes this even worse, the same teacher, upon being questioned by Millie's mom, pretty much admitted she saw the whole thing and only punished Millie because it was easier than dealing with the REAL bully. Quoth Millie's mom: "Did it hurt having your soul extracted?"
In Muertitos, the school has a zero tolerance policy. After a girl bully attacks him, Honeo is suspended because instead of lying limp, he flailed around and could have hit someone, but the bully got off scot free because her dad is rich and regularly makes donations to the school. You can see the strip here.
In Leftover Soup Jamie was mugged and shot but he grabbed the guy's gun and pistol-whipped him with it then called the police. But because the mugger was technically a minor (albeit a lot larger than the scrawny Jamie) the police took his side when he pressed charges for assault, and the only fingerprints on the (stolen) gun were Jamie's, and the press painted it as a hate crime because the supposedly beaten 17-year old was black. Jamie only got off because his accuser OD'd on PCP and killed himself.