And along with what we'd consider takeout, there were a lot of businesses that would cook the food you brought them. Like, chophouses used to be "bring your own chop". Hell, there's a place not too far from me where you can buy fish fillets and have them fried there.
Communal bakehouses, for example!
My nearby fish fry place does this as a dodge around the asinine EBT rules. Technically, all their fish is sold cold; they just fry it all for free if you want. But if you want to take it home cold, you can.
I've seen a travel food show in... i think SEA where they did this- bought weird seafood from a market and brought it to be cooked by a place nearby.
And into the early 20th century in the UK, the baker was the one person in the area who had an oven. You'd make your stew or your pie, with a unique design on the crust, take them along when the bread was out, and come back later.