I had a long answer about how to behave if a child hurts itself and starts crying, with first-aid measures etc., but deleted it in the favour of the following which is a long answer targetted at you specifically.
I find it hard to sympathize with people
Not everyone has great, or even any, empathy. You do not necessarily need to feel bad about this, it might just be who you are.
who don't believe me when I articulate the risks to them so that they can avoid it.
Be aware that 3-year-olds do look like small humans, but they are not just little adults. There is a decidedly un-intuitive path they take to adulthood. Until they are in their 20s it would be wildly misled to expect any kind of logical behaviour from them all the time (exceptions nonwithstanding). What they gain in mental capacity until their teens is regularly wiped away by hormones at that point.
And I am not being sarcastic here. There are plenty of children who seem wise beyond their years, but totally break down in times of pain, panic, anger etc. They are most certainly not capable of setting stubbornness aside for some logic spewed at them by an adult. I would never do "talking" with a 3yo if I wanted to prevent them from getting harmed (or if I did, I would not really expect it to work, certainly not getting angry about it).
Oh.
Most adults are not that logic-based as well, either, and most of the above is true for plenty of adults as well.
How do I be more sympathetic towards my children's pain?
Just stop doing what you're doing! Instead of walking away, shut up and hug them, it's as easy as that. You are an adult, for Bob's sake, and responsible for them.
You should not only be sympathetic towards them when they are in pain, but at all times. Children notice these things. It's a trust issue. Believe me, the one thing you do not want is children who do not trust you.
So next time your kid hurts, you put everything that was before aside, and go into "medical doctor mode". You check for wounds etc., apply your first-aid-course knowledge, blow the pain away, place a placebo plaster/fist-aid-bandage, and be the hero for your child.
On the next day, feel free to talk to them and ask them if it is, generally, a good idea to stand before a door. If they can't tell the right answer that 100% means that they are simply too young.
Try to imprint into your mind that children, nay, most if not all people, are not inherently trying to actively irritate you. They, as everybody, just do what they do. It is what it is. It is an illusion that you can somehow "educate" them in any meaningful way. You, as parent, set certain constraints around them, and try to stimulate their mental/emotional etc. growth, but in the end they do it on their own; in the environment they are presented with.
And yes, there are children which will do the same error again and again and again, getting hurt over and over again. As it's usually not fun for them, this makes it abundantly clear that they just can't act otherwise (or they would, to avoid the pain). No need for you to get angry about that or to assume that it's somehow about you. You patiently try to keep them out of harms way and focus on not getting angry too much.
You might also look into Buddhism. Even (or especially) if you put the religious/mystical parts aside, they have some purely logic-based and worldly mind-related techniques with which you can train yourself to be more aware of what is happening right now, and more loving of others. Youtube has plenty of material. That stuff actually works.