Pub - is short for 'public house' - a place where people (the public) can gather for a drink. It is quite traditional (its decor). A pub is a staple (a necessity) for any town or village. People go to the pub for a pint. It's a casual setting.
A bar is a place where people can gather for a drink. Its decor is often more modern/contemporary. Sometimes pub and bar can be used interchangeably. Both often serve food - 'pub grub'/bar food. Use of either term is dependent on the setting, decor, and clientele (target market). Bars sometimes have a dress code. Sometimes it caters to a particular clientele - wine bar, tapas bar, cafe bar.
In a pub, you go to the bar (counter) to order a drink. All pubs have bars, but not all bars would be called pubs.
Golf clubs, sports associations etc. often have bars (which open to serve members)
People often go to a bar and then on to a club.
A club is where you go to drink, dance and get off with your preferred sex. Its licence generally allows it to stay open later than either bars or pubs (in most countries). A club will have a DJ and dance floors.
In a club, people go to the bar to buy drinks. (Generally less beer is consumed in clubs than pubs or bars. People drink spirits and shots).