Back in my youth I used to go out to bars all the time - 4, 5 nights a week for a stretch.
I have never been bought a beer by a guy I didn’t know EXCEPT in the context of him buying beers for a group of people where I was one of them.
I would find it exceedingly strange and an extraordinary circumstance to have another man buy a beer for me.
It doesn’t happen so much in nightclubs or dance clubs. There, I would suspect that a guy offering to buy me, another guy, a drink meant he wanted something. But, in smaller bars you’ll find that it’s just a nice gesture on behalf of someone you happen to be sitting beside and conversing with. It’s a way of saying you enjoy the conversation, just a friendly thing to do. Next round you reciprocate.
Most of my drinking was in private clubs. Most would buy a round as soon as they got in the door.