People sometimes die from food poisoning and if you have had it once you won't want to repeat the experience. I am surprised people will eat at your house.
Typical reaction of someone who's never done it. I've had food poisoning multiple times - never from dumpster diving. It's always been from eating out, or from questionable leftovers when I was a college student cooking for myself the first time. It's easy to tell when food is spoiled, and high-end stores throw away things well before they're even close to spoiling. Also, when your food is free and considered garbage, it's much easier (psychologically) to throw away something that's been sitting in your fridge for 2 weeks compared to some fancy expensive food item that you paid $30 for.
As far as legality, at least in the US it's trespassing, and the majority of people will actively try to ignore you. Store employees will either ask you to leave, or tell you when the toss away the good stuff. It's always sad when you come across 30 gallons of melted ice cream, but when they tip you off and you can get there right when it's thrown away and still frozen - you're suddenly the most popular person in your circle of friends.
If you're clearly diving food food, cops don't care. Most of the time, they just drive right by. The one time they did stop me, it was after some guys ran by who were apparently in a bar fight. After checking our ID, we told them the direction they ran in and they were on their way. However, I do have a friend that was arrested for dumpster diving at an REI. The REI shared a parking lot with a DMV. The cops arrested him, thinking that he was diving for IDs. His charges were thrown away when he went to court, but it still didn't sound fun. So be aware of the context of your diving. And don't give the store a reason to lock their dumpster or call the cops (ie, don't make a bunch of noise, and leave the dumpster cleaner than you found it).
Diving with a bike trailer is fun and good exercise. If you're going to a distributor, renting a Zipcar pickup truck is the absolute best way to do it. It's quick and easy to load (back the truck up to the dumpster and toss bags into the back of the truck), and cleaning the back is a cinch.
I have had to tell people this: avoid compactors at all costs. I don't care if something delicious looking is sitting right on top. It's dangerous and not worth your life.
One of the biggest things I miss about pre-kid lifestyle is the dumpster diving. I just can't stay awake that late any more. I think people here who are saying "nope, not for me, too cheap" are missing how much fun it is. Just like riding a bike vs driving - it's not just the monetary savings. It's a ton of fun, and an adventure!