"hair of the dog that bit me" comes from the old belief that if you were bit by a rabid dog, rubbing the fur on the wound would prevent getting ill. The dog is alcohol, and the hangover is his bite, the hair of the dog is the 'little bit" you consume to feel better. Since they didn't know you were merely extending being drunk, they thought it cured a hangover.
Ask a dog. Quite a few of them here on EP I suppose.