You can't legally steal someone's trash. The courts have ruled that once you've put it in public it's abandoned and fair game.
The police do this all the time to suspected criminals. They just pick up their trash and if there's evidence there it's admissible in court.