What kind of sensor should I use?

Or mount an IR distance sensor inside (ok, will need to make sure it doesn't get damaged and clogged with crumbs). Choose one where the distance suits the size of the box. If the distance returned is less than the width of the box, there's dog food in the way. (Or, the dog has its head in the box....)

This is an example sensor, but there are others with different ranges. The voltage it gives back relates to the distance by the graph shown, so you just do an analogRead() and if the voltage is less than some threshold you will determine from the graph, turn the light on.