As we all know too well, people are opportunistic. No, because somebody is likely to take advantage of the situation by going in and stealing your merchandise or money.
Animals are opportunists too.
Dogs will paw through available garbage for a choice morsel. The problem arises however, when animals see opportunities that we don't recognize, and then we get angry at them for being so clever in taking advantage of us. What we need to do is heighten our awareness of the situations where this may occur. Unfortunately, wild animals that have lost that wariness and have more contacts with humans also tend to have shorter life spans. That's because these tend to be our problem critters, and frequently are killed or relocated.