No, it is not legal. Trash is considered private property. Dumpster diving is stealing someone's property. Dumpster diving is only with permission, which is funny because it is someone else's trash.
Mostly I just rummage for spare materials, like plywood, pipe, and spare nails (those nail strips for nail guns are really handy).
