Yes, fast food establishments and bars count as restaurants when it comes to earning rewards for dining. You simply use your credit card as usual for dining at these places.
Occasionally, a cafe or food establishment located within another facility such as a sports arena or department store may not code as a restaurant. It will depend on how that food establishment is coded by the card issuer.
Also, some cards do have a separate category for fast food and restaurants, so you’ll want to check your card’s category requirements to determine the amount of rewards you’re earning when dining at each of these.