Been there, done that, got some nice steel bed frames as the result!
TECHNICALLY it would be stealing (the trash either belongs to whoever put it there, or else to the trash collector) but often nobody cares.
When I was a kid working in a filling station the guy I worked for would haul the garbage to the dump. Invariably he would come back to get his trailer to retrieve his finds. “You ought to see what somebody left” he’d say. LOL