The sun is hot. Extremely hot. Hot things can burn. I don't believe you need to make the explanation any more complex than this, or attempt to explain it scientifically.
The answer you've given the child would likely confuse him more.
The analogy to a car accident I believe is not at all appropriate. The child presumably has no experience of car accidents, so would have no way to understand what a car accident would feel like. Speaking from experience, a car accident feels very different to looking at the sun.
If you're going to try to explain the concept of 'hurt'. It would be best to use something the child may have had experience with, grazed knees, ear infections, getting new teeth etc. The child would very likely understand that these are unpleasant sensations, so would want to avoid anything that may be equally unpleasant.
You could therefore say something like "if you look at the sun, your eyes may hurt, like your knee hurts when you fall down."
Also if you want the child to not look at the sun, avoid personalizing it. i.e. stop referring to it as "Mr Sun". The child might be trying to see Mr Sun's smiling face.