Some pacifists accept self-defense as legite
"I do believe that, where there is only a choice between cowardice and violence, I would advise violence... I would rather have India resort to arms in order to defend her honour than that she should, in a cowardly manner, become or remain a helpless witness to her own dishonor."
"Though violence is not lawful, when it is offered in self-defence or for the defence of the defenceless, it is an act of bravery far better than cowardly submission. The latter befits neither man nor woman. Under violence, there are many stages and varieties of bravery. Every man must judge this for himself. No other person can or has the right."
(Mahatma Gandhi)
https://www.mkgandhi.org/nonviolence/phil8.php