There are dumpsters where it's relatively safe to food dive. Here, a lot of places which don't have food rescue programmes double bag their stuff before putting it in the dumpster. So it's already in a container and then double bagged. Different types of stuff go in different bins and some of the bins are locked (this is mostly to prevent lawsuits if people get sick from eating it). The stuff is usually tossed on a known schedule, so if you're there soon after that happens you're pretty golden.
Tommy's diving at a housing complex, though. He doesn't know how long the person who tossed the food had it before it was tossed or how long it's been sitting in the bin. I assume that the tossed food is also in with general rubbish. A polystyrene container only offers so much protection under those conditions.
Most charity clothing bins have been removed here because people throw general rubbish in them (including spoiled food and used baby diapers), which means the charity then has to pay to dispose of the contents of the entire bin as well as having it cleaned.