We used to. They were called Vendo-mats. They had sandwiches and cakes and all kinds of things. They weren't exactly vending machines in the sense that things would fall down. The food was behind a little door you'd open after paying. I'm too young to remember what the stuff tasted like, but it seemed pretty good because the food would always have to be put in the machines fresh every day.
Oh, we had something like this in college. The vendor would load up the... well, actually, it was more like a big version of those little coolers you see in the checkout line in grocery stores—the ones with the sodas and stuff in them. Anyway, the vendor would load them up every couple days. It'd have sandwiches, salads, puddings (which were actually really popular), sodas, Gatorade, water, and a bunch of other stuff. If we wanted something, we would just get it out, scan the barcode on the scanner attached to the handle, tap our phones or cards to pay, and be on our way.
the food would always have to be put in the machines fresh every day.
ate from these on a few occasions as a kid, and no, they were not fresh every day. I remember my mom sniffing egg salad sandwiches and throwing half the ones they purchased in the trash at a rest stop. also had them at rest stops in the UK in the late 80s as well. it was not great.