I frequently hear stories about people drinking their favorite pilsener, and not liking the other brand because "they'll get a hangover when drinking that brand".
Is there a truth in this?
It's true that there are different types of hangovers.
However, those are mostly the result of differences in the impurities in the alcohol (that is, all the non-alcohol stuff that differentiates beer from wine from vodka). And for those differences, it's largely the difference between different types of liquor.
Beer is, compositionally, pretty much the same. There might be enough difference between a heavy chocolate stout and a hoppy IPA, but between different brands of lighter beers (like pilsners), there's unlikely to be a noticeable difference in hangovers barring a weird food allergy to a minor element of one pilsner vs another.
Some far more likely causes of your friends reporting worse hangovers for different brands of the same beer type are: