The line is self-defense. This includes you, your personal belongings, your family, friends and strangers who can't defend themselves. And the means have to be adequate of course.
It's ok to fight when the other party attacks. That covers potential invaders and cops, but both only in the moment they commit violence. Killing for revenge shouldn't be an option anyway.
I disagree with going somewhere else to fight "bad guys" the same way I wouldn't attack a policeman out of the blue.