"
In many places it is illegal for a restaurant to use the leftover food in a meaningful way" that really is ridiculous. If there's a law like that where I live, I would deliberately flout it. The developed world has massive problems dealing with waste and I'm sure there's far bigger threats to public health than feeding your dog leftovers.
There's some great business opportunities around waste. I've read about entrepreneurs using methane from rubbish dumps to fuel heating systems. Some great fortunes are made in the waste business (turning trash into cash to use a cliche). I remember reading a great article about one guy who converted his Hummer to run on leftovers that he collected from local restaurants. Not only did his "mpg" increase, but his cost of running the Hummer decreased enormously (he even brought food sometimes, put it in a blender, and used the chopped up food as fuel - still cheaper than a tank of traditional petrol/gasoline). It was the "Green Hummer" or some similarly named project if you wish to Google around.