First off there are several lines of defense prior to any kind of violence.
Avoid areas where there is a risk of being attacked. Don't drink alcohol. Don't provoke people. Walk away rather than exacerbate conflict. Don't make yourself a target by displaying about your person things that someone might wish to steal. Be aware of your surroundings.
I guess there is an element of luck involved for me, but all of the above have meant that I've never been in a violent conflict in my life.
If violence does occur then generally killing someone in defense is either an example of anger taking over, or not defending yourself very well. I can't really think of that many scenarios where running away is completely unviable, save for being grabbed completely out of the blue. If you are grabbed out of the blue then you have a host of options that aren't fatal. If someone is threatening violence, and you meet that threat by becoming violent yourself when you have the opportunity to walk/run away or talk them down then you aren't defending yourself you are willingly engaging in violence.
The list of situations where violence is the only option is slim, and in those instances killing generally is only going to be the absolute most extreme option. It's safe to say most of us will never be in such a scenario.
A discussion on all aspects of Theravāda Buddhism
"If only it were all so simple! If only there were evil people somewhere insidiously committing evil deeds, and it were necessary only to separate them from the rest of us and destroy them. But the line dividing good and evil cuts through the heart of every human being. And who is willing to destroy a piece of his own heart?"