A particularly notable instance occurs in Terry Pratchett's Discworld novels. In his later "Witches" books, it is revealed that Granny Weatherwax, a major character of Pratchett's, has had to Shoot the Dog more than a few times in her witching career, with few regrets. In fact, Granny considers part of a witch's job description to be making tough life-or-death decisions so other people don't have to.
Perhaps the greatest example of this is Granny Weatherwax choosing whether to save a man's child or his wife. Someone told her afterward she should have allowed him to choose. Her response? "What has he ever done to me that I should hurt him so?"
In The Fifth Elephant. Angua (the werewolf) asks if Carrot (her boyfriend) would "put her down" if she became as crazy as her brother. Carrot answers yes. Angua smiles and asks "Promise?"
The biggest example of Shoot the Dog in the series was in Night Watch.
Willikins engages in a few of these during Snuff, in part so Vimes - who's already testing his personal limits during the book - doesn't have to. In addition, Wee Mad Arthur's sideplot sees him having to give the same help Vimes did in Night Watch.
In The Gunslinger, Roland is forced to choose between finally catching the Man in Black (the only one who can tell him how to reach the Dark Tower) and saving young Jake from falling to his death. As a clue to which he decided on, let's just say he found out how to get to the Tower. To be fair, in Roland's mind, anything is permitted because Roland believes the entirety of all existence (and, indeed, non-existence) is at stake. And Jake gets better. And Roland's belief happens to be right on the money.
In John Steinbeck's novel Of Mice and Men, protagonist George is forced to pick up a revolver and kill his mentally handicapped best friend Lennie who has inadvertently killed Curly's wife. George's reasoning for this is to spare Lennie from a horrible death at the hands of the inevitable lynch mob. This trope is also shown in a lesser extent earlier in the novel (with an actual dog, and with the same gun too!).
Rachel has to do this a lot of times in Animorphs, so much so that by the end it's considered just part of her character. For example, she's the one who forced David to be trapped in rat morph.
The man who later becomes John Clark in Tom Clancy's novels tortures a guy he captured for vital information - using a pressure chamber to induce the bends. He also does other things like assassinating people, and a cat-and-mouse game with some Big Bads near the end. But you can't say you weren't warned: the book's title is Without Remorse.
In A Song of Ice and Fire, Eddard Stark takes it upon himself to kill his daughter Sansa's pet direwolf Lady at the queen's order rather than allowing the prince's creepy bodyguard to do it, because if he does it himself then at least he can minimize Lady's suffering and prevent her pelt being taken by the queen, and because he thinks the direwolf shouldn't have been a pet in the first place and will become a danger to people other than the evil prince. Later, he realizes that his children's direwolves were indeed sent by the old gods to protect them and that killing one was a foolish mistake.
Jaime Lannister sees himself as this regarding his most infamous deed, the killing of King Aerys. Lannister was part of the Kingsguard, an elite group of bodyguards and protectors sworn to defend the King and the Royal Family. However, Jaime knows just how psychotic Aerys was, having witnessed his many atrocities first hand. Between the realization that Jaime was only ever accepted into the Kingsguard to be a hostage used against his father, and the knowledge that Aerys was planning to burn down the entire capital city rather than surrender to the rebels marching against him, (a city of more than a million people) Jaime decided to kill Aerys and all the pyromancers involved to avert this. As a result, Jaime sees himself as a dog shooter. Everyone else sees him as an oathbreaker with Chronic Backstabbing Disorder, which is not helped by Jaime's general Jerk Ass nature and refusal to disclose what really happened.
The Yearling. Does a very good job of illustrating the consequences of not shooting the dog fawn.
The Guns of Navarone. Captain Mallory has discovered that Anna is a traitor and is forced by the circumstances to execute her. As he prepares to do so, Anna's friend Maria shoots her instead so Mallory doesn't have to.
Watch on the Rhine from the Legacy of the Aldenata contains a group example, when Hans Brasche order "only old SS will engage. New men are not to fire except in point self-defense." The situation is that a resurrected Waffen SS is being attacked by a horde of Posleen using massive number of human shields. The new men can't bring themselves to fire on their own species, but the old SS have done it before, so... Actually, there's probably at least one instance of Shoot the Dog in every novel in that series.
Although it's built up like this to a degree, the mass murder of Zalasta's cronies in David Eddings' Tamuli trilogy is kind of an aversion. Not only were the dogs in question rabid, but some of the deaths and corpse disposals were just so damn funny.
This led the subsequent Lords of the Land to the Oath of Peace, as one of their leaders put it, if it comes down to a choice of Desecration or Defeat, then they will permit themselves to be defeated rather than desecrate again.
Harry Potter: Dumbledore arranges for Snape to kill him in the 6th book for two reasons — to protect Snape's Reverse Mole position with the Death Eaters, and because he knew Voldemort had already ordered Draco Malfoy to kill him and he wanted to spare the boy the fate of being a murderer. Although the act of Snape killing Dumbledore is initially viewed by Harry, the readers, and Snape himself as a villainous act, Dumbledore had previously asserted to Snape that it would be treated as a mercy killing and wouldn't carry the same moral repercussions that cold-blooded murder would — because Snape knew that Dumbledore was already weakened and irreparably doomed to die from the curse on Gaunt's ring.
In The Lymond Chronicles, Lymond frequently has to take these kinds of actions. The worst is when he saves his friends and defeats the Big Bad by ordering the death of his own two-year-old son. Later, he whips one of his men nearly to death as punishment for a minor error in order to prevent the tsar from killing the man for sure.
This is why Commander Thrawn shoots the Vagaari ships covered in living shields in Outbound Flight; the captives were going to be killed anyway, there was nothing they could do to help them, and the Vagaari had to be stopped.
In Star Trek New Frontier, the much talked-about Grissom incident came down to a war tribunal started by Calhoun's captain. Calhoun, charged with mutiny by said captain, stepped in to stop him from killing the leader that led him to this madness (by killing the captain's brother and daughter). He comes to the conclusion that he must kill the leader. However, he does it in a way that could be construed as self-defense because the leader handpicked a phaser off of the captain. Calhoun resigns anyway because even after Shooting The Dog, he failed to keep his captain from committing suicide.
In the Ciaphas Cain novel "For the Emperor", Commissioner Cain has to do this twice;
First when he's desperately trying to get a wounded Tau ambassador back to their compound (since letting them die would lead to a civil war breaking out), they're stopped by a group of loyalist PDF. The loyalists assume they're traitors trying to defect, so Cain has to order the guardsmen with him to shoot them (which he was well within his rights to, since they disobeyed a direct order from a commissar).
At the end of the book, a couple of guardsmen who had accompanied Cain on a mission are recovered alive. When he listens to the story of how they survived, he realises they had been infected by genestealers and executes them before they realise what's going on.
In the fourth book of Codex Alera, Lord Kalarus has bound one of the Great Furies, the animating spirit of a volcano, to him, so that when he dies it will erupt and destroy the nearby city of Kalare plus all the refugees that will have flooded to the city, the armies of Kalarus, and the armies of the First Lord that will be laying siege to the city. First Lord Gaius Sextus does not approve, and with the help of Amara and Bernard goes through a rather grueling ordeal to sneak in close enough to prevent this. Since he could not prevent the release of the Fury, instead he releases it early, reasoning that this way, even though the city still dies, the thousands of refugees and soldiers that would have been caught in the later blast are spared.
In The Handmaid's Tale, the main character and a fellow handmaid are forced to witness a supposed rapist being murdered via an angry mob of women egged on by government officials. Her companion, however, knows that the man is actually a member of the resistance who has been caught, and the only thing she can do in order to avoid giving herself away as a traitor is to kick the man violently several times in the head until he falls unconscious (or dead), sparing him torture at the hands of the mob before he dies.
Made the more painful by the fact that it was avoidable, the situation had arisen because of a long chain of very human and understandable, but still very bad decisions on the part of various people, but esp. Harry and Susan. One of the themes of the DF series that has emerged is the critical importance of free will, and how good decisions usually produce good results, and bad decisions...the Archangel Uriel has been kind of 'coaching' Harry on this, but Harry has been a bit of a slow learner on the subject, and it's cost him dearly. Susan has an even worse track record of bad choices, and paid an even higher price.
Anita of Anita Blake brutally tortures and kills a man to gain information about where Richard's mother and brother are being held in Blue Moon. She decided to do it instead using slower methods due to the revelation that they were being tortured and raped. Several of Anita's people begged to be allowed to Shoot the Dog for her, but she decided she couldn't ask anyone to do something she refused do herself. This is the moment she identifies as being the trigger for setting her on the path of becoming a sociopath.
Alexander the Great did this several times and in Mary Renault's The Persian Boy the most logical reasons are presented. After uncovering a plot to assassinate him, he kills Philotas the instigator, and also has his father Parmenion killed. In Renault's version, this is so there won't be a big blood feud, as Parmenion is in charge of troops and supplies guarding the army's rear. When Alexander kills the 7000 Punjabi mercenaries, Renault says this is because after he'd defeated these soldiers, he'd signed them up (or thought he had — there might have been a bad translation) to work for him. But they began packing up and moving out in the middle of the night, which boded no good. He knows history will look down on him for it, but "it was necessary".
Happens often in The Forest of Hands and Teeth, though the aversion of this sets the plot in motion. Mary's mother is bitten by her zombie father, and instead of being killed before she can turn into a zombie, she decides to just be allowed to turn. Later on, her brother's wife Beth becomes a Zombie Infectee and has to be killed before she turns, despite her brother's objections. Even later on, Mary's lover is infected and she ends up having to behead him herself.
In The Chronicles of Amber, Corwin's blinding and imprisonment is shown to be a shoot the dog moment long after the fact. Julian explains to Corwin that if Eric had left him alive and at liberty, the Bleys-Brand-Fiona cabal would have almost certainly killed him in short order. Blinding was the only way to leave him alive, but harmless.
In Queste, the fourth book of Septimus Heap, Septimus and Jenna fight the Toll-Man and throw him down the Abyss, causing a Heroic BSOD in Jenna. It is revealed that the Toll-Man was under Demonic Possession then and almost managed to kill Septimus.
In Derek Robinson's Piece of Cake, Barton shoots the dog. The dog's master had just been killed, so it was either a mercy killing, or he did it to stop the dog howling so he could get to sleep. Or because the dog wouldn't stop pissing on people's legs every chance it got. That's why it's called Black Comedy.
In the second Mistborn book, Vin literally kills a dog, so that her shapeshifter(who can only take the shape of the creatures it's eaten) can impersonate it and follow her around inconspicuously. (She's also kind of disgusted by the thought of it eating people, even people she just finished killing.)
In Those That Wake, this is done to Brath as hopelessness corrupted him beyond saving.