This phrase comes from the old myth that if you got bit by a dog, and took a clump of that dog's hair and rubbed it on the wound, it would kill all the bactiria in the cut and help it heal faster. Modernly, this term is referred to as having such a hangover, you drink whatever you drank last night to help get rid off it.
Person 1: Dude, I got so drunk last night that I woke up with a ultra-hangover.
Person 2: Did you try using the hair of the dog?
Person 1: Yea, and I think I found the secret to eternal drunk.
Person 2: Nice.
Vodka drank the next day to defeat a vodka hangover; an update of hair of the dog that bit you. Other drinks could be substituted for vodka as long as you come up with a new animal. For example, hair of the demon that violated you could be tequila.
Bruce Lee: What's in that?
Jose Contreras: Some more vodka. I'm struggling from last night, hopefullythis shit will ease me up.
Bruce Lee: Ahh, hair of the bear that mauled you, huh?
Before the days of paracetamol, a traditional rumoured cure for a hangover was to put a small amount of dogs hair (or a whole dog) to your nose.
The pheromones given off by canines were said to help alleviate dry mouth and headaches caused by excessive home distilled gin and other strong alcoholic drinks