Do you know what the difference is? In one situation, you care if you go to jail or not.
You should always care whether you go to jail or not surely? If, as in your example your wife has been raped, how would killing the person responsible and going to jail help her at the time when she needs understanding and support not a Neanderthal possessive reaction. It wouldn't not be self defence nor in defence of someone if you beat them up after the crime. If you use violence to prevent a crime against a person and can justify that violence it's self defence, you cannot however be a vigilante.