There is a theory called the "good genes" theory that can perhaps explain some of this. Some animals, generally males, will purposefully participate in dangerous or risky behavior such as exposing themselves to predators in order to attract a mate. The perspective mate may subconsciously think that type of behavior is a sign of strength. If he is willing to put himself in danger, he must have "good genes."
Applying this to human males there are a lot of similarities. I once had a professor who often referred to it as the "Hey everyone . . . watch this. . ." phenomenon. This of course is what young males say just before doing something incredibly risky.
Some females may be attracted to it because they feel these risky behaviors are a sign of strength.