This is both Commander Shepard and Garrus in Mass Effect.
In the sequel, Garrus has embraced this; he pisses off every gang on the station and subsequently gets his team killed. The people of Omega seem to think he made a difference; the Archangel name wasn't his idea. The families of his team also seemed to support Garrus's actions, one in particular telling him not to blame himself for her husband's death because he died doing what was right.
Whether Shepard's Paragon or Renegade, s/he will steal the Normandy after it's locked down by the Council in order to stop the Reapers.
The Paragon end to Mass Effect 2 is this when you opt to destroy the Collector base, even though it could be beneficial in the future, stating "We'll fight and win without it, I won't let fear compromise who I am.
It comes up again in Mass Effect 3 with the salarian STG. If Kirrahe is alive, he'll promise the unwavering support of the STG regardless of politics, even if the Dalatrass calls off salarian support for helping cure the genophage. And he delivers.
Mass Effect 3 actually has a ton of examples if you look closely. On Liara's terminal, for example, you find evidence of a politician who decides to commit political suicide by stealing the private wealth of his government to help evacuate citizens.
Councilor Gujir: Phillips, I am authorizing you on behalf of this city's Senate to seize any and all eezo stockpiles in our treasury, in order to secure safe passage for our citizens on any available ships. Secretary Phillips: These look like private stockpiles. Senate members' stockpiles. Councilor Gujir: I'm foregoing re-election. Now get us those ships. Secretary Phillips: Yes, sir!
Army Of Two. Overlaps with Screw The Money, their Mission Control asks them if they want to let the authorities handle it legally, but they decline as they know the Big Bad is currently in the process of killing witnesses and destroying evidence inside the HQ.
BioWare pulled an arguable double subversion in the backstory of Knights of the Old Republic. The Republic was getting hammered by a Mandalorian invasion and the Jedi were staying out of it because they sensed a threat behind the Mandalorians. While Revan and Malak's intervention likely saved the Republic, it got them Drunk on the Dark Side, caused them to try and destroy the Republic in order to "save" it, and turned the Jedi Order into shreds. The double subversion hits when you realize that the Council was right in detecting a threat behind the Mandalorians, even if their approach probably wouldn't have turned out any better than Revan's.And Revan and Malak didn't turn to the dark side right away after that, they were forced to become Sith when they confronted the Sith Emperor.
Another one of their subversions was in Jade Empire. The Brothers Sun were violating the laws of heaven in their assault on Dirge, committing genocide on the monks, and crossing the Moral Event Horizon in too many ways to count. Still, they thought it was the only way to stop the drought that was killing thousands and left the empire on the verge of collapse.
And it actually was — the problem was that, by doing so, they royally messed up the overall balance in the world, as the rain they were now getting was being taken from where it was originally meant to go.
Ace Attorney Investigations has this with the Yatagarasu, two attorneys and a detective who resorted to finding evidence of crime through theft when the law wouldn't reach far enough for them. This becomes a mirrored dilemma for Edgeworth late in the game, when he must decide whether to use Badd's stolen evidence against Alba, since legally it can't be used at all.
Final Fantasy X has this when Yuna and company decide to try and defeat Sin without using the Final Aeon.
This is also how Tidus meets Yuna, and arguably, an Establishing Character Moment; after learning that the apprentice summoner has been inside the Cloister of Trials for over a day, he decides to go in after her, yelling "Like I care!" when he's told it's taboo not to do so.
A major theme in Tales of Vesperia. The protagonist, Yuri Lowell, believes that if a law prohibits doing what's right, said law should be ignored. His friend Flynn, however, argues that vigilantism cannot bring peace, and that if a law is corrupted, then it needs to be changed. The game is rather good at avoiding taking sides in this, with both characters getting their share of trouble when they take their ideologies to the extreme.
"If you can't do something smart, do something right." may have been said by Jayne, but Space Quest games tended to base themselves on the idea. Break into a heavily-fortified, but legally-operating, sweatshop software company and free some programmers from the Corrupt Corporate Executive? Sure, that was game 3. The Designated Hero of Starcon has ordered that you stick to collecting trash and not look into the suspicious dumping of toxic waste? Screw it, the Eureka is going to look. Ordered in game 6 to ignore the highly suspicious death of a close friend by a prominent admiral's widow who tried to kill you in the process? The quote was "Bite me, Commander."
The entire last half of Modern Warfare 2 has Soap and Price going after Shepherd to kill him in revenge for his betrayal, even if the world paints both of them as international terrorists.
In Fallout, the Brotherhood of Steel are rather strict about who they let join, and who they let keep technology more advanced than a flashlight. However, in Fallout 3, we have Elder Lyons, who, when he and his chapter arrived in the Capitol Wasteland, looked around at how bad things are and basically said "Screw the Codex!" Now the DC Chapter of the Brotherhood goes around as something like a post-apocalyptic Chivalric Knighthood, dedicated to helping the downtrodden of the area, and working with them to make things better.
In Fallout: New Vegas, Veronica can try something similar where she leaves the Brotherhood to join the Followers of the Apocalypse. This ends poorly, both for the Followers and Veronica.
In Kingdom Hearts, Donald and Goofy reluctantly follow Riku when he wrests control of the Keyblade from Sora, since they were told to stay with the Keyblade holder. They quickly changed their minds and stood beside Sora when Riku attempted to kill Sora.
In Kingdom Hearts II, during the siege of Hollow Bastion, King Mickey ordered Sora, Donald, and Goofy to escape so they could find Riku and Kairi. Sora protested, but Donald told him, "You heard what the King said." They then plunged into the thick of the battle, thinning it out considerably. Mickey let it slide.
In Diablo III, Tyrael refused to go along with his fellow Angels' non-interference policies. When his superior Imperius tried to punish him for it, Tyrael finally had enough and tore off his own wings so he could help Sanctuary as a mortal.
Tyrael: "You cannot judge me, I am Justice itself! We were meant for more then this, to protect the innocent! But if our precious laws bind you all to inaction, then I will no longer stand as your brother."
The Eitrigg incident in World of Warcraft. Tirion Fordring (Knight in Shining Armor) repels his OWN faction to save an enemy because the enemy saved his life previously. This resulted in Tirion being "stripped" of his titles and powers except not really, because his powers came from morality, not from a ceremony and losing his own wife and child.
This worked out in the end. Tirion eventually became the greatest paladin in the world and the only one the evil Lich King ever feared. So yeah, DO NOT mess with Tirion Fordring and his honor if you value your life.
This is the reason that Vol'jin is readying a stand against the Horde; Garrosh is getting too bloodthirsty, his Kor'kron are acting as Secret Police, and they've found an artifact that could make the Sha a threat that's not native to Pandaria anymore.
In Might and Magic: Heores VI, Duke Slava of the Grffin Duchy ends up opposing Emepror Liam; the Emperor has ordered all orcs in the empire be exiled in preparation for a war against the demons, but the orcs in Slava's lands are old war buddies who helped him bring down a demon-worshipping shaman, and he's quite happy for them to stay there. Plus, the duke put in charge of the purge is a Jerkass and one of Slava's enemies.
In Halo 4, the entire crew of the UNSC Infinity does this. Master Chief disobeys Captain Del Rio's orders to hand over Cortana for "decomissioning". Del Rio then orders his bridge crew to arrest John-117 for his disobedience, and nobody steps up to do so. He then orders his XO, Lasky, to prevent the Chief from leaving. Lasky lets the Chief commandeer a Pelican, while the guards on the Hangar Bay salute him as he does it. In a twist, UNSC's command is not exactly happy with Del Rio abandoning a War Hero that had literally saved the entire galaxy, and he's the only person aboard the ship who gets punished.
Hawke can follow this code, depending on your choices in the game. Have enough influence with your friends, and you can convince them to do the same.
Dead or Alive: After Raidou attacks the Mugen Tenshin village to steal the secret to their most powerful Ninpo, crippling Hayate and rendering him comatose in the process, Kasumi, rather than take Hayate's place as the clan leader, ditched her position and ran off to kill Raidou and avenge Hayate despite full knowledge that her actions would have her banished from the village and marked as a runaway shinobi.
Metal Gear Rising: Revengeance: After Raiden uncovers Desperado and World Marshal's plan to transform kids into cyborgChild Soldiers and war criminals, he promptly resigns from Maverick and goes on a bloody rampage through Denver to save the kids from that fate, determined that no child go through what he did during the Liberian Civil War. This quote sums it up quite nicely:
Raiden: Being legal doesn't make it right!
As Bright Noa deliberates during Scenario 20 of Shin Super Robot Wars, Bright gets an unexpected transmission from someone he's never met before: Chief Oka of the Federation Far East Base. He asks if Bright is planning to heed the order he just got to return, and Bright says that he doesn't see any alternative. Oka is adamant that Bright do no such thing, saying that as Bright is well aware, Staff HQ is anything but sane these days. There's no call for Bright to be punished for the whims of a few lunatics, especially since he and his men are one of the few glimmers of hope mankind has left. Bright briefly protests that disobeying would get all his men branded as traitors, but Oka firmly points out that fighting the aliens comes first. He tells Bright to leave things to him and his friends at Staff HQ, though The Reinforce Jr. itself will have to be relinquished.
Amuro is impressed with Oka, and after all the transfer is complete your people decide to go to the Moon. This will fulfill the League Militare's needs and let Amuro pick up the Nu Gundam from its commissioned builders at Anaheim Electronics. Usso is a little sad to see Gomez go, but most of the rest of the crew are still with the Londo Bell.
In Shin Megami Tensei IV, Walter chooses to ignore the Archangels' standing orders to invade Tsukiji Hongwangji and kill Lilith, instead choosing to join her, as he has come to the realization the "peace" the Archangels seek to enforce goes beyond Crapsack World, and Lilith, monster though she may be, is still the best bet to change the world in his eyes.
In Metroid: Fusion Near the end of the game, it turns out the Galactic Federation wants to contain and capture the SA-X virus to use as research/a biological weapon, despite the fact that the SA-X is nearly invincible and will undoubtably kill them all, multiply, escape to every corner of the Galaxy, while still multiplying and ending all civilization in the universe. This gives Samus no choice but to self-destruct the Space Station, despite their order for her to stand aside
In the Star Trek Online mission "Surface Tension", the Romulan flagship R.R.W. Lleiset is called back to New Romulus after briefly aiding the player character, the U.S.S. Voyager, the U.S.S. Enterprise-F and the I.K.S. Bortasqu' in saving Earth Spacedock from the Undine. When those same ships are under attack during the invasion of Qo'nos, the Lleiset warps in with her captain, Tiaru Jarok, declaring "The Romulan Republic has made commitments to its allies. We are here to honor them."