The standard derailleur hangers made of aluminum alloy are extremely fragile and non-durable. Technically, it makes sense: in case of an accident, the derailleur hanger absorbs the entire force of the impact, preventing the damage to the frame, so its owner does not have to replace the expensive frame. But you should agree that it is still a disadvantage: sometimes the impact is very weak, but the derailleur hanger breaks. It lacks some elasticity to make it deform, rather than break.
Even if the standard silumin derailleur hanger is just bent and is not broken, it is a bad idea to try to straighten it. The internal strain and the micro-cracks will do the job all the same, and such a crippled derailleur hanger will break very soon: if not during the straightening process, then surely after the very first obstacle.
Does it mean condemnation of all derailleur hangers? Surely, it is not. Our machined derailleur hangers are made of special 6061 T651 (similar to D16Т) aviation aluminum that boasts increased flexibility, as compared to standard duralumin, not to mention the fragile silumin. If the impact was really insignificant, it is quite possible to straighten such a hanger: its flexibility and strength will not be affected. However, it is not worth trying to do it yourself: take the damaged part to a workshop, where your derailleur hanger will be straightened with special tools in no time.