The once-shamed practice of dumpster diving has surged in popularity on social media. But is it legal?