Captain Dylan Hunt of the Andromeda Ascendant. Perfectly nice and agreeable guy and eternal optimist. He is also a seasoned military officer who has started a war, destroyed thousands of ships in one fell swoop, and if you screw him over, he will drag you down with him and let you experience the results first hand. "Right now, my bad day is your bad day, enjoy the view."
Spike in Angel. During a brief stint at Angel's old job of helping the helpless, he stops a vampire from killing a woman. He then proceeds to insult the crap out of her for being dumb enough to be walking down a dark alley dressed the way she is.
Hell, Angel himself was this trope from the beginning, especially as he got "older". A Retired Monster who preferred to solve problems with non-violent tactics, he was also accepting of the fact that, sometimes, a lot of people must die before positive change will happen.
One of the main themes of the Angel's spin off TV show is his character struggling AGAINST this trope. Throughout the show, Angel is clearly a hero, doing good and rescuing those in need. But from the very start of the pilot episode we see him wanting to cut himself off from people, because he worries about hurting those that gets too close. In the pilot he is told quite clearly that if he doesn't learn to be more empathetic, then not only will he fail to truly save people, it's also only a matter of time until he himself becomes corrupted. This becomes a reoccurring conflict for Angel's character, in the following five seasons. Season 2 in particular had a major arc about this, with Angel deciding to become more ruthless and cold in order to be a more "effective" champion for good, and this temptation was a major part of his character throughout the series. Ultimately he would always come around to the realization that just punching the bad guy in the face was not enough and that "being nice" was actually the more important factor in being able to save people. This is summed up nicely with his so called "epiphany speech" in Season 2, which ends with him saying: "the smallest act of kindness is the greatest thing in the world."
This has been one of Wesley's defining characteristics since his early days on Buffy, although it becomes even more noticeable after he takes a few levels in badass. When things are quiet, he can be perfectly amiable, but when there's something bigger at stake, he's more interested in getting results than being nice. Long-term solutions are much more important to Wesley than short-term politeness.
A prime example is the second season episode "Untouched", where Team Angel is attempting to help Bethany, a young woman who has telepathic powers she can't seem to control. Angel and Cordelia are both very gentle with Bethany, doing their best to help her keep calm and to make sure she feels safe with them. Wesley, on the other hand, after figuring out that her powers were the result of intense psychic trauma from her childhood, intentionally provokes her by mentioning the person who hurt her. She's extremely upset by it, and Angel and Cordelia both berate Wesley for being so harsh, but Angel later admits that it was a useful thing for them to know, because it allowed them to help Bethany in the long run.
Hauser: You, your friends; you're conflicted, you're confused. And that's why you're gonna lose. Because we possess the strongest thing in the world: conviction. Angel: There is one thing stronger than conviction. One thing. Mercy. [kicks Hauser's shotgun, making him blow his own head off] Mook: What happened to mercy?! Angel: You just saw the last of it.
Saul Tigh of Battlestar Galactica is an unfriendly, grumpy bastard with an alcohol addiction and is the first to call out for the execution of a Cylon. He's also Lawful Good, fiercely loyal to his best friend and superior Bill Adama and is not afraid to sacrifice himself if necessary.
Doc Cottle is a gruff old man who mouths off to people and absolutely refuses to put out his cigarette even when patients request it, but he's a good surgeon who takes his job very seriously regardless of who the patient is. He also has no problem pulling rank over both Admiral Adama and President Roslin when they're doing something needlessly risky that just happens to be a medical issue.
Temperance Brennan in Bones is brilliant but arrogant and insensitive. She has dedicated herself to catching murderers, and spends her days dissecting and analyzing corpses. She has developed a matter of fact attitude towards death and decay, and often forgets that not everyone shares her calm, professional view. As a result, she thinks nothing of thoughtlessly spewing the graphic details of a murder to grieving loved ones, or showing gory images to a class of young children. She has improved a bit over the years, but still has plenty of moments in the later seasons.
And theres intern Oliver Wells, whos an arrogant, narcissistic jerk with a superiority complex. Angela wrote him a bucket list and all the items involved not being a douche.
Hank Schrader from Breaking Bad. He's a wisecracking jerk, but also an exceptional agent who deals with extremely dangerous criminals.
Cordelia Chase on Buffy (and to a lesser degree on Angel) is selfish, abrasive, and, when not being intentionally rude, is still staggeringly tactless. On the other hand, when it comes to fighting the bad guys, she's as brave as anyone else, loyal, and brutally honest.
Also, Giles. Despite how he acted in the first few seasons, he's often one of the most sarcastic and foul-mouthed people on the show (never picked up on by most due to him using mostly British swears). Plus, he'll kill humans if he must, an opinion only shared by him until Season 8, as seen when he smothers Ben, the human host the of the Hellgoddess to death with a handkerchief in order to permanently destroy her.
Wishverse Buffy from "The Wish" certainly wasn't nice, or even helpful, for that matter, instead expecting people to point her in the direction of what needs killing.
Michael Westen of Burn Notice. Always fights for the good guys, the underdog, those with no other place to go — and he and his cohorts have been damned ruthless while doing so, including Sam Axe shooting a pistol into the ground as he listens to a rather hysterical stand-off between two Bad Guys of the Week. The next sounds you hear are some fatal gunshots. In case you felt bad for them, they kidnapped a kid and were going to kill him.
Mark Fallon on the Castle episodes "Setup" and "Countdown". He is a Homeland Security agent assigned to help track down a bomb. He is an extremely dour sort but he is dedicated to his job and does it well. His dourness as it turns out comes from the fact that his wife was killed on 9-11.
Deputy Chief Brenda Lee Johnson in The Closer will fight for her people and for the victims of crime, but will run rough-shod over anyone and everyone (including her husband the FBI agent) to solve her case. In one notable episode she was after this rich young punk who has fled to Mexico after raping and killing his family's Mexican maid. Brenda threatens to charge his mother with aiding and abetting his escape unless he explained the entire thing to her. He cheerfully does so and then arrogantly tells Brenda she can't touch him. Brenda agrees that this is true, but then she points out that he is in a Mexican police station with two Mexican police officers who understand English standing behind him and he just confessed to raping and murdering a Mexican girl. They promptly arrest him for the rape and murder and drag him away to a life sentence in Mexican prison, stated to be far worse for him than the similar sentence in US prison. Even Brenda acknowledges that she may have gone a little too far to close this case.
Several later seasons revolve around one case in which Johnson released a suspect who she could not convict, after making his gangster friends believe that he had sold them out. They murder him. Brenda knew that would happen, and a wrongful death lawsuit nearly cripples her unit over the next season.
Det. Scotty Valens would certainly justify. Although he was originally rougher in the earlier episodes, he still had plenty of Jerkass tendencies about him, such as having a Hair-Trigger Temper, not being afraid of resorting to violence when called for it, being confrontational with suspects—even the innocent ones—and mocking of some victims and their loved ones. One episode even had him snickering at the mere thought of a dead, overweight cold case victim being involved with a handsome man who had recently committed suicide over her (and he insulted the other victims of the killer as well, saying that none of the women striked him as a having more than one date). However, when he was finally confronted by the killer, one of the very average-looking women he kept insulting and called him out for being the shallow, unpleasable jerk that he and other men like him are, he wasn't laughing at all.
Det. Nick Vera on occasion, as well. Aside from also not being above using violence towards/bullying suspects and witnesses alike, he also becomes involved with some of the "hotter" female suspects (in spite of how unethical it is), cheats on his wife on numerous occasions (who then leaves him midway through Season 3) and comes off for the most part as a boorish, borderline misogynistic Jerkass who at one point wrote off a bunch of hearing-impaired students who were using sign language to communicate as "fighting" with each other and gossiping about him. Even the events of "Flashover" in which a man he wrongfully accused of murdering his children is later killed in prison that causes him to go into a downward spiral comes off as Laser-Guided Karma rather then paint him in any sympathetic type of light.
Dexter: Sergeant James Doakes is a cold Jerkass with a penchant for violence, but a damn fine cop and a good person at the end of the day.
Also Deb Morgan, who is pugnacious and not always friendly, but an ethical cop with a passion for justice.
Doctor Who: The Doctor is often sharp and blunt with people, and has been known to rub people the wrong way at times. When the Abzorbaloff in "Love & Monsters" accuses the Doctor of being "sweet" and "passionate", the Doctor agrees. However, he also adds "...don't ever mistake that for nice". (However, this rebuttal was somewhat part of a bluff.) The Doctor doesn't entirely fit this mold all the time, but he has been known to, especially in his first, sixth, ninth and twelfth incarnations.
The Fourth Doctor also had some very "alien" moments, like showing no emotion over the death of an Innocent Bystander. (Though by no means the norm for him, there was still a large gap between himself and his previous, more "human" incarnations.) Robert Holmes' primary concept for him was "Olympian detachment", which he contrasted heavily with the villains in his era (most of them being completely overinvested in minutiae, and hopeless at controlling their emotions).
The Seventh Doctor and Ace were a Brains and Brawn duo of this. Unlike a lot of the Doctors, who stumbled into trouble without even trying, Seven and Ace actively sought out corrupt governments, power-crazed entities, and other threats to try and topple. Sure, they got the job done and sent the bad guys packing, but Seven could be incredibly tactless and psychologically brutal, playing everyone like pawns in a game of Xanatos Speed Chess while Ace veered into Psycho Sidekick traits like an unhealthy love of explosives, car theft, and clobbering a Dalek to death for calling her "small."
Adam, then a new companion of the Ninth Doctor's, winds up in a future news station and gets tempted at the prospect of using future knowledge in his relative present to make money. This indirectly endangers the Doctor, who nonetheless escapes unharmed. The Doctor's punishment? Taking Adam back to the present with a future device in his head that opens panels to his brain whenever someone snaps their fingers. He tells Adam, a child genius who's seen the future first-hand, that if he wants to escape being dissected by the government for his future tech, he has to live a dull life.
The Tenth Doctor also fits the bill. Although he's often cheerful, gregarious and friendly, he's equally often arrogant, dismissive and downright ruthless. It wasn't as obvious in his first season, but after the loss of Rose, this trait kept popping up more and more frequently. He showed signs of mellowing out a bit by the time Donna came around, but after having to wipe Donna's memory of their time together, he starts skirting into Moral Event Horizon territory, particularly in "The Waters of Mars". The Familyof Blood have a few things to say about him, too. When he tried to run and hide from them, they thought he was a coward to be hunted down. Turns out, he was being kind. What he does to them when he finally decides to fight back is pure And I Must Scream.
Madam Kovarian: The anger of a good man is not a problem: good men have too many rules. The Doctor: Good men don't need rules. Today's not the day to find out why I have so many.
Twelve is so much this trope crossed with Pragmatic Hero that his character arc in Series 8 has him questioning whether he's actually good at all. The answer is that he's an "idiot" who's always learning and helps out whenever he can. Ultimately, the moral decisions should be left up to the people he's helping. To quote from "Flatline", his companion's A Day in the Limelight episode in which she has to take over his duties and does too good a job, "You were an exceptional Doctor, Clara. Goodness had nothing to do with it." His Arch-Enemy is the Faux Affably Evil Missy, who acts nice but is not good. While he softens over the course of his Myth Arc and comes to an understanding of his inner kindness and nobility, he's always a tough cookie, and his Final Speech before he regenerates, addressed to his next self, advises them to "Always try to be nice, but never fail to be kind" summing up this trope in a nutshell.
The Time Lords. Despite being the "most powerful and mighty race in the universe" and ostensibly the Big Good by default, Time Lords encountered over the course of the classic series tended to be rude, condescending, and incredibly corrupt, having been born into a society that had grown so decadent and stagnant over millions of years that the Doctor claimed it was one of the reasons he left. In the revival series, they come to avert this trope as they are regarded by the rest of the universe as no better than the Daleks thanks to their actions in the Last Great Time War; while there are genuinely good people in their ranks, the most powerful ones are shown as being responsible for truly despicable deeds in "The End of Time" and "Heaven Sent"/"Hell Bent".
The Fist Team from Double the Fist are here to help. They want the world to be more activate and powerful, and helped save the woodland from loggers once. However, they have also murdered a number of innocent people, destroyed a lot of public property, and eventually conquered the world. Their hearts are in the right place... Well, Mephisto may enjoy his work a bit too much.
Malcolm Reynolds of Firefly. If his damn conscience didn't keep dragging him towards good and let him get on with his life as an amoral rogue, he'd have singlehandedly won the War of Alliance Aggression. (At least, that's the way he sees it nowadays.)
When Sandor Clegane accuses her of being too soft for wanting to spare the peddler they just robbed, Arya beats the recovering man unconscious again.
Sandor himself typically does display a moral compass that mostly functions properly, but few in-universe (or out of universe, for that matter) see that through his very rough exterior. This is most present in his treatment toward the Stark sisters, especially Arya, engaging in (seemingly) a fight to the death with Brienne when he thinks the latter is trying to take Arya back to the Lannisters, even though all along he stressed he was only holding onto Arya for the ransom money once he finds a family member to pawn her off on.
While having very compassionate side, Brienne demonstrates this when she kills a rapist northman with a vindictive Groin Attack.
Although Jon Snow is a Nice Guy and compassionate, he has his moments of this. He shows up his lowborn fellow recruits with his superior combat skills until Tyrion sets him straight by pointing out Jon's privileged upbringing to him, which makes Jon realize how rough the other recruits had it, resulting in Jon teaching them how to fight properly and bonding them as friends. In Season 3, the wildling warg Orell fights with Jon in a battle to the death after Jon refuses to kill an old man. During this battle to the death, Jon kills Orell while telling Orell that he was right about him all along: he has always been loyal to the Night's Watch. He can also be somewhat brooding.
After her attempted hostage exchange fails in an attempt to save her son and her son is murdered in front of her, Catelyn Stark slits her captive's throat as she said she would.
As much as Dr. House wants everyone to think he only does it for the puzzle, many episodes show in his behavior that he does genuinely care, and has on several occasions put himself in harm's way to save the patient's life. Sure, he may say he doesn't really care about people, but, well... everybody lies. In spite of his genuine goodness, however, he regards everybody else he meets as an idiot, and tells them as much to their face.
The Indian Detective: We first see Devo strong-arming a suspect into telling him about a bank robbery. He comes off as prickly at best to begin with, and resents Doug interfering in his jurisdiction. However, he turns out to be an honest cop, unlike his superior, helping Doug and Priya go after Gopel.
Keisuke Nago follows this trope to the letter in Kamen Rider Kiva, to the point where all five reasons listed in the opening paragraphs that a person could experience this trope apply to him. He eventually mellows out, but it takes half the series to happen.
Tsukasa Kadoya is similarly a massive jerk to everyone he meets, though he swiftly softens because he has at least three Morality Pets: Natsumi, Yuusuke, and eventually an alternate universe version of Tackle. It's implied he's so jerkish because he feels resigned to his fate as the Destroyer of Worlds, something everyone except the aforementioned three keep telling him over and over.
Tendou Souji is an Insufferable Genius who has no problem showing people how much better he is than all of them. Like Tsukasa though, he has two Morality Pet in his sisters, Juka and Hiyori. His friendship with Kagami also cause him to soften up a little and by the end of the series, it's pretty clear he cares a lot about the people close to him.
Elliot Stabler in Law & Order: Special Victims Unit can be a Jerk with a Heart of Gold- but he enforces the law and is on the side of good. Well, he enforces criminal law, but tends to be a bit more flexible with the constitutional rights of defendants, and has a nasty habit of injuring suspects. A good guy to have fighting for your interests, but not the guy you want investigating you if you're innocent. He'll get to the right answer, but it'll be a bumpy ride.
On Leverage, Nate is this in spades, being able to manipulate others at will without concern over their well being apart from helping people. This is also true for the rest of the team in many ways, though all of them are more kind than Nate, who is generally seen as a bastard by most. He also has Intelligence = Isolation as well.
Jacob on Lost. While he may work to good ends, he doesn't seem to care much about what happens to the people he uses along the way to achieve those ends. So much so that for much of the final season fans frequently speculated online that in the end Jacob would turn out to be the evil one and the Man In Black the good one.
In Lost in Oz, Bellaridere's soldiers capture Alex and company, and she's essentially blackmailing them to fight the Witch. On the other hand, she does have the best interests of Oz in mind.
Patrick Jane in The Mentalist. He catches killers, thieves, and rapists, but he is not nice, frequently pissing off other law enforcement officials just because he can. He'll also embarrass his teammates and blurt out secrets for no real reason. And he never, ever just comes out and says anything relevant if he can set up an elaborate way to trick it out of someone instead. He does have a soft spot for children, but that's it. It's often mentioned that if he wasn't so damn good at what he does, he'd have been fired or possibly killed by now.
Parodied on Monk. Monk is so demanding of his dry cleaners that he is charged extra, and eventually banned from the place. Of course the murderer is a more courteous customer. Even after being informed of his deeds, the dry cleaner still thinks the murderer is a better customer than Monk.
Gibbs in NCIS is certainly good, and never would be described as nice. He's rarely really mean, but sometimes he is. Reasons 3 and most of 4 apply (we're never given the impression he actually wants to be a nice guy).
Summer Roberts from The O.C. can be bitchy, rude, and inconsiderate, but she also saves Christmas when needed.
April from Parks and Recreation revels in causing discomfort and generally making others' lives more difficult, all while speaking in a creepy monotone. She often has to be bribed into taking things seriously. But behind the "actual witch with powers who is evil" persona, she's a caring individual. Her words don't convey it, but she's extremely supportive of her friends and shows her appreciation for them through thoughtful actions, and she even takes breaks from tormenting the people she hates to help them, too, as much as it pains her. Eventually it becomes clear that she genuinely wants to help others achieve their goals and make Pawnee a better place for its people.
Merrick in Power Rangers Wild Force starts out this way. He fights alongside the others, but he won't join them on their downtime, hangs out in a bar when at least one team member is underage, and actively pushes them away when his personal demon comes back to claim him. He mellows as the season goes on, and by a few episodes before the end he's describing them as his friends.
Rocky Mountain Bounty Hunters, which follows fugitive recovery agents as they bring in bail jumpers, certainly don't have much sympathy for the guys they're bringing back to the police. Then again, the ones they're chasing after tend to be hardened criminals with records on them.
Sapphire and Steel: Steel combines this with a bit of Blue-and-Orange Morality. He's very blunt and short-tempered with humans, though this is often to discourage them from getting involved in dangerous situations they don't understand. If they do get involved, however, he'll try to protect them, but is not above shooting a few dogs if necessary.
Dr. Cox of Scrubs is willing to risk his career to save a patient's life, but is not an overwhelmingly friendly person and gladly insults a patient who has different opinions than him. Differing opinions, the woman he loves, his favored protégé, complete strangers... Cox is not a nice person, but see his reactions to losing friends and patients. Lampshaded in the pilot episode; Dr. Kelso is outwardly nice and friendly, while Cox is an obvious Jerkass, which is why JD is surprised to discover Kelso is pure evil and Cox is the one who actually helps him along as a doctor.
The title character of Sherlock is this in spades. He helps solve crimes, but only because he'd be bored without cases to keep him occupied. He tends to ignore any sort of human element to his cases and has been self-diagnosed as a high-functioning sociopath.
"I may be on the side of the angels, but don't think for one second that I am one of them."
Rodney McKay of Stargate Atlantis is about as rude, obnoxious, and anti-social as they come, but, despite his vocal cowardliness, he's one of the first to put his life on the line for the greater good, and is capable of truly awesome heroics whenever his internal "Chance of Impending Doom" gauge redlines.
Also, there's Ronon Dex, who can be outright mean, is hard to get to know, and takes a long time for him to warm up to you enough to trust you as a friend. But when that time comes, he's a fierce fighter.
The Asgard seem to have this as a species hat. While they are mostly benevolent and oppose the enslavement of humans, they also tend to be massively arrogant (although not entirely without reason) and rather condescending towards the Tauri (Earth humans) and other "primitive" lifeforms. (Despite the Tauri having saved them from extinction more than once.)
Captain Jonathan Archer in Season 3 of Star Trek: Enterprise. The entirety of Season 3 is an arc in which the crew of the Enterprise must go on a mission to stop aliens who intend to destroy the Earth. Needless to say, Captain Archer takes his responsibility pretty seriously, and goes to some lengths to ensure his mission is a success. This includes torturing an alien to get information out of him by deoxygenating the room he's in, stealing a vital engine component from an innocent ship to ensure that Enterprise can reach a key alien base in time to save the planet, and also creating a fully conscious clone of one of his crew who is badly injured, so that he can harvest its organs to give to the crew member (although in this last case he agreed to the procedure believing that the clone would survive the transplant and be allowed to die a 'natural' death afterwards, only learning that this was impossible after the clone was created).
Every one of the good guys on Supernatural, but Castiel, the angel, deserves special mention. He might work for the greater good, but he and all of the other angels are warriors of God. He's a soldier. The angels aren't there to follow anyone around or perch on anyone's shoulders. Seriously, they're about as far away from Roma Downey as you could possibly get.
Sam and Dean, in different ways. Sam can be absolutely ruthless for the greater good and has a nasty streak of anger issues. Dean has no compunctions about forcibly stopping people before they screw things up and spent ten years "studying" under Alastair as a torturer in Hell. He's still got the skills he learned there and has put them to "good" use on occasion, even if he doesn't like that part of himself.
Derek Hale of Teen Wolf actually devotes himself to protecting others, but is rarely sociable even to those closest to him and does not maintain the pretense of friendship even with people like Scott and Stiles, who he will readily risk his life to protect. There are times when he seems to want to be more neutrally-aligned, but he invariably goes back to helping people despite himself. His past history serves to explain his desire to keep others at a distance.
Wonder Woman: In the pilot, Wonder Woman blows up a submarine, killing all on board. In "Anschluss 77", she kills the clone of Hitler by using her magic lasso to force the doctor to reverse the process.