There's no evidence that a hangover is caused by alcohol withdrawal in most cases[0].
I think the thought behind "hair of the dog" remedies like a beer with breakfast is either A) getting a little drunk again helps you ignore the hangover or B) Drinking alcohol again causes your body to produce enzymes that process acetaldehyde. Acetaldehyde is a byproduct of our bodies processing alcohol and is thought to contribute to the hangover, along with the well-known effects of dehydration.
[0] https://pubs.niaaa.nih.gov/publications/arh22-1/54-60.pdf