Derailleur hangers are usually aluminum, but they're pretty substantial and anything that could put significant stress on them while riding is likely to come from something that would be catastrophic even should the hanger survive the event totally unscathed. Things like a chain side plate coming loose and catching on the rear derailleur cage or the rear derailleur cage itself getting caught by a rear wheel spoke aren't going to end well even if nothing happens to the hanger at all.
I'd just remove the rear wheel, maybe unscrew the hanger itself from the frame (might not even need to remove the rear derailleur itself or even the chain), and inspect the hanger, looking for cracks or deformation beyond a simple bending of the main part of the hanger. For example, is the screw hole ovalized or otherwise distorted?
If there aren't any cracks nor any distortion, I'd ride on it.