Can one eat lunch? Because, lunch is not food itself, one cannot eat it.
I think lunch does not only refer to the time one eats the food, it can certainly refer to the food. And merriam-webster agrees with me:
1: a usually light meal; especially : one taken in the middle of the day
2: the food prepared for a lunch
So, analogous to meal, breakfast, dinner, on can certainly have it and eat it.
In contrast, this doesn't work with cake:
You can't have your cake and eat it.
It seems that with meals, which we can have, the meaning has shifted (or grown) to include also the specific food to be served at the meal, and because of that, we can also eat a meal. But food can be either had or eaten, where having the food does not imply eating it. So the extension of meaning only works in one direction, from meal to food, and not from food to meal. That said, on can order a steak by saying I'll have the steak, please, but strictly speaking, the fact that you probably intend to eat it once they give it to you is only implied.