Dogtown is the twenty first episode of Season 28 and the season finale.
When Homer's court case determines that a dog's life is more profitable than a human's is, the status of man's best friend rises in Springfield. When the dogs recognize their new position of power, they assert their dominance over the humans.
Homer is driving in his usual manner and style (ineptly and recklessly) when he careens into an alley without any room to maneuver and too late to hit the brakes, where Santa's Little Helper and the now-homeless Gil are eating out of trash cans. Homer is horrified by the notion of running over a sweet and lovable dog, so he slams into Gil instead, who sustains a serious neck injury and plans to sue the Simpsons for everything they have got.
The jury accepts the defense argument that dogs are not only as good as humans, but better in many ways, and they dismiss Gil's case. Mayor Quimby chooses to ride the pro-pooch sentiment by instituting measures that cater to canines and punish humans who do such activities, like round up strays and even run animal medicine stores like the poor Dr. Budgie, who gets arrested and put into shackles.
Dr. Budgie's plea for Springfield to realize that the dogs will soon observe that humans have advocated their alpha status and turn on the citizens isn't taken seriously until it actually happens. Even Santa's Little Helper joins the feral dog pack, as the town takes shelter from the now-vicious dogs, and a town meeting leads to the community begging their most broken-down citizen to help them: Gil. Gil is prepared to face down his fellow street creatures, but it is Marge who steps up, and after finding out the leader of the dog pack is a vicious chihuahua named Taquito, kicks the canine from their showdown park and becomes the new alpha of Springfield.
All of the dogs are reunited with their owners, from Ned's puppy Baz and Mr. Burns' hounds, to Lisa and Bart's joyous reunion with Santa's Little Helper.
In the final scene, Gil thinks he has found a new friend in a weakened Taquito who licks Gil's hand and barks happily. Gil doesn't realize the hound is only being friendly so he can get a taste for Gil before he finally passes on and Taquito eats his corpse.