I'm not sure about that. Since ancient times there were places where you could pay for food, but that was always a side business of an establishment whose main purpose was either (a) selling alcohol (or, in some places, coffee or tea) or (b) providing lodging for travelers.
I suspect that an establishment whose main purpose is selling food to order may be a fairly recent innovation.