“Hair of the dog that bit you” is a colloquial expression most commonly used to refer to alcohol that is consumed to lessen the effects of a hangover. The phrase was originally used by the Romans who, like other ancient cultures, believed that “like cures like” (similia similibus).
Quite literal in it’s day, people bound hairs of a dog that had bitten someone to that person’s wound so that it would induce healing. This treatment was recommended for centuries and mentioned in serious medical texts. The first mention of the phrase in reference to hangovers is in John Heywood‘s “Proverbs” (1546): “I pray thee leat me and my fellow have a heare of the the dog that bote us last night – and bitten were we both to the braine aright.” (wiki, Encyclopedia of Word and Phrase Origins)