Let's for the want of a better term, call the part where the hanger sits on the frame the hanger mount. If this part is bent, it is usually bent inwards just because that's the way bikes fall. If it is bent inwards, it thus presents the hanger with a bulge and the hanger cannot seat properly in one, guaranteed position. There will be the straight hanger that sits on top of a wobbly mount and its final position is a combination of the torque in the mounting screws and the tightness of the QR. To spot such a problem, release the wheel (don't remove) and tighten the QR whilst watching the hanger from the rear of the bike so that you can see the mount and the hanger. If the two move vis a vie one another, you have a bent mount. Just as an aside, if you see the frame and hanger move vis a vie the hub, you have a bent axle or bent frame.
To check if your frame is in alignment, do the following.
Place it on a stand. Remove the wheels and other things as they get in the way in the next step. Tie a piece of long string around the seat tube just above the BB. Now wrap the string symmetrically around the bike. For instance, go from there to the right dropout, through the left dropout, back to the bb, to the head tube, around the head tube, back to the seatstay etc etc. Now tie off the string and walk around the bike, eyeing the various distances between string and frame. An misalignment quickly shows up. Obviously you have to ignore asymmetric chainstays (Pinarello) and BBs (Cervelo) but apart from that, the string doesn't lie. You can do the fork independently with its own piece of string. If you include the fork in the frame wrapping, it messes things up because it is floppy and moves about.