Yes, bars do count as restaurants for credit cards most of the time, especially when the bar serves food. If a bar is classified as a restaurant based on its merchant category code (MCC), that bar will always count as part of the credit card's dining rewards category.
If the bar is classified as a “drinking place” instead, the bar will only count as a restaurant if the credit card's dining rewards category includes the MCC for drinking places. Many dining rewards categories do include the MCC for drinking places, but it's never a guarantee.
Popular Credit Cards that Count Bars as Restaurants
Bank of America Premium Rewards credit card
Capital One Savor Cash Rewards Credit Card
U.S. Bank Altitude Reserve Visa Infinite Card
Citi Premier Card
JetBlue Card
The easiest way to find out if a bar counts as a restaurant for your credit card is just to buy something at the bar. You can then check your credit card statement to see if the purchase got the dining category rewards rate or the base rewards rate. Alternatively, you can call the bar and ask what their merchant category code is, and then call the card issuer to ask whether that merchant category code is included in the credit card's dining rewards category.