Always play it by ear, but be prepared to pay. If they are paying, which is the norm, let them. Don't fight it.
Several times, I've had a company buy me lunch, dinner, plane ticket and hotel room to come out for an interview, and the like. Only time I've ever had to pay my own was with the rental of a vehicle, which I believe is connected to the liability insurance risk. They reserved it, but I had to use my own credit card to pay for it and then get reimbursed.
Even when the company is paying, you should still consider being reserved. It's an opportunity for them to see if you are frugal or extravagant. Whether you will have the ability or authority to approve spending decisions or not, you might be tasked with reviewing a product or software and it's better to be seen as frugal than extravagant with the company's money. While you don't have to order the absolute cheapest item on the menu, do NOT order the most expensive item on the menu.
Generally the company will be very upfront about it. "Order whatever you like. The company is paying." I once was told almost these exact words. The executive then went on to praise the blah-blah-blah on their menu. It was a median priced item, it was what he ordered, so it was what I ordered. Subtle directions like that should be followed, unless it's something you are allergic to or you really do not like. It may sound simplistic, but it's an easy way to plant a brief message in their mind. "Frankie likes the Club Sandwich, so he must be a good guy." If you are one of the final candidates, a hiring decision can be swayed by such nuances.
If you get no such directions, choose wisely in terms of how easy the item is to eat. BBQ ribs have a high potential for making a mess of you and your clothes. If it's a BBQ place, maybe order a pulled pork sandwich.