The common saying "beer before liquor never sicker and liquor before beer have no fear" always made me wander why is that? What is the science behind it?
I had never heard of this saying (I'm not a native English speaker), but the funny thing is that in Dutch there is a similar saying, except with wine instead of liquor and the other way around: 'wijn na bier is plezier, bier na wijn is venijn'. This roughly translates to 'wine after beer is fun, beer after wine is poison'. I once read an interview with a toxicologist about this and according to him the order in which you drank made no difference. One explanation I heard was that in the olden days, beer was the drink of the poor people, while the upper class drank wine. So if you went from beer to wine, you moved up in society, while the other way around meant you got poorer. So, not really an answer to your question, but there might be a similar, not really alcohol-related explanation to this expression.
I suspect that there is no science behind it and that the saying is something akin to an old wive's tale, something often re-told but not actually scientifically accurate.
It might be the case that people who start with beer and end with liquor sometimes get sick because they loosen up with a beer buzz, and start drinking liquor too quickly. But there is no reason why the order of the two alcohols has to have this result if the people drinking stay moderate in how much they're consuming.
Conversely, if they ended with beer the rate of alcohol intake slows down meaning they'd be less likely to get sick. But they still could get sick.
In my experience when I was a young drinker there were a lot of sayings like this floating around. Usually just things that people said that sounded funny, rather than real warnings.