When it comes to dumpsters on private property, some people will have more leeway than others. For example if you live in an apartment complex with dumpsters, you can go diving without any trouble. If the cops show up just say you threw something away by mistake. Since you live there, you're not trespassing.
If it's a dumpster on your job site the cops will probably be suspicios. Your employer even more.
MIB