Things like that is typically allowed to happen to people or animals on the wrong side and on a mission to attack the innocent victim. In that case the victim or his/her protector uses lethal force against the attacker.
It could also happen if the the one on the wrong posses a serious security threat to the victim and is determined to cause serious harm to him/her.
Nevertheless, there should always be chance given to such people to surrender. And non-lethal attack that is very likely to effectively disable the potential attacker should be used first