Western Fantasy Fiction has Drasek Riven from the Erevis Cale trilogy and The Twilight War. The second chosen of Mask, God of Thieves, Riven is a dark hearted angry man. The main character of these books, Erevis the first chosen of Mask, even remarks upon Riven's status as the better killer. Riven is a literal case of Petting the Dog, as the first sign of a good sign to him is when leaving a stakeout because he 'has other business to attend to'. Following Riven through the city we discover that he has two mongrel alley dogs he regularly feeds with scraps bought from a butcher. Before leaving the city, Riven even goes to the effort of paying (quite handsomely) a man to feed the dogs for the next year. Riven's case could have been done poorly, yet he never loses his status as a badass or suffers from Badass Decay; all of which is a testament to the author.
Lord Vetinari has several pet the dog moments — most related to his ancient terrier Wuffles, and more recently, Mr Fusspot.
Its said that, once a week, Vetinari goes to the grave of the late Wuffles and puts a dog biscuit on it. Yes, the tyrant of Ankh-Morpork, trained at the Assassin's Guild and who would kill people without a second thought if he thought it was in the interests of the city, still cares for his dear little dog.
Granny Weatherwax, meanwhile, acquires a kitten in Wintersmith, which she promptly names You (as in: "Stop that, You!"). She makes a show of not caring for it... but then cares for it when no-one's looking. By the end of the book You is found curled up on top of Granny Weatherwax's head, under her hat (Granny gives the lame excuse that it keeps her head warm).
Another Granny example; in Masquerade, Agnes (or Perdita X, as she called herself for most of the book) was held in mild contempt by Granny for a large portion of the book. After Agnes has had all her hopes at being an opera singer crushed (despite being the real heroine), she reluctantly returns to Lancre. Granny, in a rare moment of genuine kindness, tells Agnes that as a young woman, she called herself "Endemonidia" (but not for very long), showing that even she started off as a bit vain and stupid.
Maybe subverted and maybe not when Granny saves Diamanda Tockley (who hates Granny and is responsible for allowing the elves to invade) from the realm of the elves. When she is shot and knocked out by a poisoned elf arrow, Granny picks her up, slings her over her shoulders, and flees while the elves shoot at her. When Nanny admits to being impressed that she did this, Granny just claims that she was using the girl as a human shield. Of course, she probably could have run a lot faster if she wasn't carrying someone else...
Greebo is one to Nanny Ogg. Despite the fact that Greebo is part homicidal, part sadistic and all wild fire explosions, he is still a cat except when he's a human. That does not stop Nanny Ogg from loving it. Subverted in that Nanny Ogg has a penchant for being nice but breaking out the badass when it is appropriate.
Even Death has a fondness for cats. It's not so much the cats as that he has a fondness for people.
In From the Earth to the Moon by Jules Verne, the antagonist, Captain Nicholl, eventually challenges one of the protagonists, Mr. Barbicane, to a duel in the wilds of Florida. When two other protagonists try to stop the duel, how do they find Captain Nicholl? He has put his weapon aside, to save a small bird who has got stuck in a tarantula's net.
Significant is Jaime Lannister, who is the only member of his immediate family to show any kindness to his brother Tyrion. He gets a few more as the series progresses.
Jaqen H'ghar pets Arya. Which is horrific news for several of the nastier villains.
One of Gregor Clegane's men, Shitmouth, is mentioned as giving captives extra bread if they want.
Melisandre's creepy magic and morally dubious methods (including assassination and human sacrifice) frequently put her in conflict with King Stannis' other advisor, the loyal and upright Davos Seaworth. But in A Dance With Dragons, she tries to keep Davos' 12-year-old son out of danger because she feels sorry for Davos and doesn't think he needs to suffer any more grief.
Raistlin of the Dragonlance saga, a treacherous, twisted Villain Protagonist (albeit an ensemble one) driven by bitterness and insatiable ambition, has a kindly streak when it comes to the downtrodden and pitiful... as he knows firsthand what it feels like to be helpless and hated. This leads to many Pet the Dog moments, especially with Bupu the Gully Dwarf, who inadvertently becomes a kind of Morality Pet.
Childhood's End by Arthur C. Clarke includes a sort of intentional and public Pet the Dog, when the Overlords issue a decree that all nations of the world must have strict laws to prevent animal cruelty. It's unclear whether the Overlords really are that nice and well-intentioned, or if they just want everyone to think they are.
In the Warcraft novel Lord of the Clans, Grom Hellscream chastizes his fellow orcs for kidnapping a child, since that was not how warriors acted.
Variations of this happen a few times in the World of Warcraft as well, as Grom is highly suspiscious of the Forsaken because of their willingness to use the Plague against the living, and views it as a highly dishonest way of engaging in warcraft.
In Joe Abercrombie The First LawBlood Knight Ferro is almost on the point of killing The Igor Severard because he was trailing her and asks him for any reason why she shouldn't. After reflection Severard says that he's worth killing, but the birds he usually feeds don't deserve to lose that source of food. Ferro doesn't kill him — which is arguably one of her own rare Pet the Dog moments.
Star Wars Expanded Universe. Mandalorian Walon Vau, a Drill Sergeant Nasty type, dotes upon his pet strill Lord Mirdalan. He takes Mird with him everywhere, wipes up any food it spills on itself, is prepared to sleep outside with the strill when it isn't permitted indoors. The man is tough as nails, but he takes Mird into battles in the same way, and with the same care, as fathers in his culture take their sons.
One could argue that the entire Gaunt's Ghosts and Ciaphas Cain (HERO OF THE IMPERIUM!) book series of Warhammer 40,000 are extended Pet the Dog moments for the entire Imperium of Man, showing unmodified, poorly equipped, (relatively) poorly trained human beings fighting wholeheartedly for the Imperium and the Emperor, and that many of them are genuinely good people with noble motivations, forced to fight horrors beyond comprehension by sane minds.
In fact most games, books, whatever that are about one planet or army will be this.
In the X-Wing Series, Imperials who aren't all bad inevitably Heel-Face Turn into Rebels. As Imperials they avoid the casual cruelty of their peers. In the books, one Imperial Star Destroyer captain has a scene where he fusses over his outfits, trying to pick the one that will please his lover the most. Another goes over how he was assigned to wipe out a village which had produced an assassin, and while he did destroy it, he went down and told everyone first, and gave them time to evacuate. In the comics, Sixtus Quin admires how the Rebels fight before being betrayed and pulling a Heel-Face Turn. And Baron Soontir Fel has stunning integrity and loves his wife.
In The Thrawn Trilogy, our first real look at the smuggler and Knowledge Broker Talon Karrde has him having dinner with Mara Jade and telling his vornskr, a doglike creature, to leave. He chastises it mildly and tosses it a bit of meat before it leaves.
Yun, a Dark Jedi apprentice from the Dark Forces Saga novelizations, is spared by Kyle Katarn, which starts all sorts of philosophical questions going in his mind. He begins to wonder if the Dark Side really is stronger, and if his masters are right. His first and most significant Pet the Dog moment is when a cave-in in an archaeological mine traps a worker beneath a massive slab of rock. The other workers and droids can't lift it as it slowly crushes him. Yun, unwilling to leave the man to die, as any other Dark Jedi would, tells the others to get ready to pull him to safety and focuses all of his willpower on lifting the rock. He succeeds just long enough for the soldiers to save the man, and only afterwards realizes that he had abandoned the Dark Side when the chips were down.
The only Star Wars villain less likely than Jabba the Hutt to have a pet the dog moment is Palpatine, but in a bit of EU canon a close friend of Jabba's recalls the time the Hutt saved his life. Long before the events of the original trilogy, Jabba and Ephant Mon were raiding an Imperial weapons cache only to be double crossed and attacked by stormtroopers. They escaped but were caught in the middle of a fierce blizzard with no transportation or shelter. When Ephant Mon passed out from the cold, Jabba shielded him with his layers of fat to keep him warm, saving his life. This wasn't because the Hutt needed him for some reason, but because they truly were friends.
Jefferson Pinkard from Harry Turtledove's Timeline-191 series starts out as a very likable character but slowly does a Face-Heel Turn until he's become the alternate universe's equivalent of Adolph Eichmann, ruthlessly sending the black population of the CSA to their deaths in concentration camps. However, to the end of the series he genuinely loves his wife and stepson and often worries about what will happen to them when the war turns bad for his side.
Jake Featherston—the CSA version of Adolf Hitler—gets a few himself, usually with his secretary. Described as a phenomenally ugly woman who is incredibly sensitive about her appearance, Lulu is devoted to Featherston, upon whom she nurses a sizeable crush. Featherston doesn't view her that way at all, but he does go out of his way to be polite to her, and doesn't tolerate anyone else being mean to her. At the end, when she's fatally wounded in a plane crash, it's Featherston who—at her request—puts her out of her misery.
Henry, from The Secret History, did organize the murder of one friend, attempt to kill another, and represent himself as a Magnificent Bastard in general. But he did save Richard from dying of exposure in the Vermont winter.
Mayor Poynt of the second Welkin Weasels trilogy is a spoilt jerk who steals money from charity collections and leaves the actual running of the city to his sister, but after an operation he's accidentally left to wake up in Bedlam House. Seeing what it's really like frightens him enough that he arranges for it to be cleaned up and turned into a proper hospital.
In Earth (The Book), the authors (this book is jokingly intended to be read by aliens who visit Earth long after we're all gone) take time to give Pet's a special section when discussing animals, and end their notes saying, "we're good boys. yes they were."
The Wolfhound once rescues a girl who was gangraped and Driven to Suicide by some thugs. Seing how women abuse is his personal Berserk Button, he immediately sets forth to hunt them down. He slaughters all but two thugs in the first encounter, and when he approaches those two, they try to plead for their lives: one tells that he was the one who convinced the gang leader to spare the girl's life, and the other - that he was only holding her. Neither case works.
Hilarously lampshaded in the Knight and Rogue Series. The villain of the second book has taken pity on a mute dog and given it food and shelter. Fisk is unimpressed by this, saying he's known many villains who were kind to animals and more who loved their mothers.
It's easy to spot the hero of Robin McKinley's Deerskin as heroic. Not because he's a prince of the blood (he is, but he didn't ask to be born one), not because he's tall and blond and heroically built (he's none of those), not because he gallops into battle on his mighty charger (he doesn't) ... but because he sits up at night with orphaned puppies.
In The Lord of the Rings, Sauron lets Gollum go after he tortures all the information he needs out of him. This action is so bizarre that many ascribe it to genuine compassion on Sauron's part. More cynically, it could be because Sauron thought he would work more mischief if he were let go, not unlike when Morgoth let Húrin go in The Children of Húrin.
In The Silmarillion, Maedhros's attempt to save the sons of Dior, and Maglor's fostering of Elrond and Elros. In both cases, said children were killed and/or orphaned because said Elves (reluctantly) led a completely unprovoked invasion of their homeland.
Skeeter's introduced as a minor villain in the first Time Scout book. The second doesn't give you much reason to think otherwise, until you learn about his back story. Just before that happens, he keeps a promise and gives a small fortune to a friend known to be perfectly innocent and good.
Horribly subverted in one chapter of the fifth The Wheel of Time book. The viewpoint character is a mook whose plan is going dangerously badly, and who is thinking about how he would much rather be back home instead and how much he misses his beloved sister. Then the plan fails completely and he has to kill an accomplice to cover his tracks; and as he's disposing of the body at the end of the chapter he goes back to reminiscing about his sister, and what a pity it was that she discovered what he was and would have exposed him...
In Harry Potter and the Half-Blood Prince, we see that Narcissa Malfoy might be a snobby pureblood supremacist like her husband, but she still is willing to risk Voldemort's wrath to find Snape (who, at this point, is morally suspicious to the good guys, the bad guys, and the readers in general) and beg him to protect her son from the suicide mission he's been given. Bellatrix, meanwhile, cements herself as a monster by dismissing Narcissa's fears and panic as her failing to realize what an honor her son was granted.
This is taken even further in the final book. Narcissa is the one who checks Harry's body after Voldemort used the Killing Curse on him. Of course she realizes he is alive, but she does not reveal this information to Voldemort. Instead, she asks him one question: Is Draco alive? At Harry's confirmation of her son's welfare, she turns to Voldemort and, with a completely straight face, lies through her teeth. This action leads almost directly to Voldemort's demise.
Subverted in the case of Mad-Eye Moody. After he seriously upsets Neville on his first day of class, he invites the kid for tea, talks to him about Herbology (the one class Neville is very good at), and loans him a book about magical plants of the Mediterranean. We later find out that "Moody" was secretly one of the people who tortured Neville's parents to insanity and only gave him the book as a way for Harry to figure out how to beat the Second Task, to get him one step closer to the plan to resurrect Voldemort.
Filch's one redeeming quality is his love for his cat, Mrs. Norris. Of course, most of the students hate her almost as much as they hate her owner.
Although Chichikov (the main character of Dead Souls) is a cheapskate, the author informs us that he'll always give a copper to a beggar.
In the Indian novel The White Tiger: Even though Balram kills Mr.Ashok and shamelessly bribes the police to start his own business, he does have his moments, such as taking his nephew Dharam to the zoo and compensating the family of the boy one of his taxi drivers killed.
Blake Snyder's Save the Cat: The Last Book on Screenwriting You'll Ever Need doesn't just discuss this trope - he's the alternate Trope Namer.
The later books in the Honor Harrington series like to do this with the Mesans. One of them is a fan of Manticoran classical music, another one is a genuinely loving husband and father. The fact that they aren't monsters by the standard metric only makes what they do all the more chilling.
There's a hugePet the Dog moment in Antonia Forest's Autumn Term involving Lois Sanger, the Marlow twins' arch nemesis, who gets them both kicked out of Guides earlier in the book, and makes trouble for Nicola Marlow later on in the series. Their form opt to put on a production of The Prince and the Pauper for the school festival, and Tim Keith, who writes the play, wants to narrate. However, Tim is terrible and Lawrie Marlow panics about the play being a failure. Tim remembers hearing that Lois is a good reader, and when she shows her the script, Lois is impressed with it and offers to do the narration herself, effectively saving the play.
Subverted in the third book of The Immortals. Emperor Ozorne genuinely loves and cares about his songbird menagerie (that's why Daine is there, because they've taken sick). His nephew Kaddar, though, complains that Ozorne cares way more about the birds than the actual people of Carthak and Ozorne winds up being the Big Bad.
Played straight in Protector of the Small. Lord Wyldon ignores that Kel is keeping Jump as a pet and when questioned, says he's just a palace stray that's taken a liking to the pages. By the end of the book Wyldon has gotten over his dislike of a girl page. (We also learn that Wyldon's family is known for breeding dogs.)
Subverted again in the second Provost's Dog book. Big Bad Pearl Skinner likes dogs, and she's quite outraged when Beka tells how she separated scent hound Achoo from an abusive handler. Beka's a bit irritated to find that Pearl has one redeeming quality among her cruel, self-centered ruthlessness.
In the Rainbow Magic series, Jack Frost and his goblins get a lot of these moments, usually when they've done something really bad and realize it.