Well My personal opinion. Dumpsters are no different then Trash Bags,
or trash can on the Curb. as far as contents.
If I saw someone take my Trash Bag, or open & dig through it,
I would have a chuckle,
because, Trust me, after adding all kinds of trash including left over food & egg shells
would not be Pretty.
I would get upset if I found out, some detective did it in hopes of setting me up
by finding something in my trash. but again at the same time chuckle over their desperation
and the smell they would most certainly need to fight.

& for nothing
As for a Dumpster in my back yard, Tuff call.
You are right, some gun happy person would shoot first,
& warn after

but me personally, I'd just blow it off as someone
after my own mindset. "there is treasure everywhere"
only difference, I don't throw away possible treasure
But trespassing is still trespassing, if someone is willing to pursue charges.
Just like a Dumpster behind Wallyworld or a place that discards Copper.
and yes people have been arrested dumpster diving at the local house trailer
plant. of course i have no idea if the trash was meant for the landfill.
But if the dumpster diver asks that's a whole different animal.
Unless there is something there illegal you are hiding, like a dead body,
Or the contents are promised or aern't meant for disposal,
What's the loss by them not going to the landfill for them to pick through ??