Are there any jurisdictions where there is a defense to criminal charges of murder or rape or assault, when carried out by the victim of a serious crime by the crime victim as retribution, in circumstances where the murder or rape or assault committed by the crime victim does not constitute self-defense or a defense of others?
It is possible in the UK for a person to have a partial defence to murder in very specific circumstances, one of which may possibly include the defendant acting in "retribution".
Under English Law, there are three special defences which exist solely for the crime of Murder. One of these defences, is the defence of Diminished Responsibility.
The defence is set out in s.2 of the Homicide Act 1957, and it provides that a Defendant is not guilty of murder if, during the murder, he suffered from an abnormality in mental functioning, where:
The defendant must, at the relevant time, have been suffering from a recognised medical condition
This condition must provided an explanation for the Defendant's acts and omissions in doing or being a party to the killing.
This condition substantially impaired the Defendant's ability to do one or more of the following:
a) To understand the nature of the Defendant's conduct
b) To form a rational judgment
c) To exercise self control
The reason why this may be applicable in the context of revenge or retribution, is in the principle case of R v Ahluwalia
In summary, a woman murdered her husband, by pouring petrol on him in his sleep, and setting him afire.
She was held to be not guilty of murder because of this defence. Specifically, the court held that she suffered "battered woman syndrome" as the result of 10+ years of emotional abuse and beatings by her husband, .
The reason why this is relevant to the question is because when giving her reasons for killing her husband, she stated:
"She wrote to her mother-in-law from prison saying, amongst other things, that the deceased had committed so many sins, "so I gave him a fire bath to wash away his sins". However, in the course of interview she repeated a number of times that she did not intend to kill the deceased, but only to give him pain."
It is certainly arguable that her actions fall within the meaning of retribution.
Of course, not just any kind of provocation will raise this defense, you need to be suffering a mental condition, but it is clear that this condition may arise directly from the actions of the victim. I highly recommend reading the full judgment, as the court goes in depth through the law on provocation (since here, on the day of the killing, the husband told the Defendant that he would beat her the following day), and whether the pre-meditated nature of the killing (she bought the ingredients for the fire beforehand, having already decided to set the victim on fire) meant that the defence could not apply.
Not quite an absolute defense, but related: Crime of passion.
Many countries accept (or used to accept) acting "in the heat of passion" as a defense, or at least mitigating circumstance. While this is not quite the same as retribution, in practice it was often applied in situations where the general opinion was that the accused had been "wronged" or "provoked" before commiting their crime, so in practice if often applied to acts of retribution (particularly to honor killings)
For example, in Italy article 587 of the Criminal code prescribed a lower punishment for killing one's spouse, daughter or sister "in the heat of passion" when the victim was involved in "illegitimate carnal relations". The article was only abolished in 1981.
If you consider jumping bail to be a crime, and the bail bondsman to be the victim, then many states in the US allow wide latitude in committing assault in response.
There also is significant latitude given to police officers alleging violations of drug laws in committing acts that would otherwise be considered rape.
No, revenge is not a legal defense in any country, because the law and revenge can not coexist as you would not have an organized system of laws, if you could simply act out to get revenge.
There is a course that studies those who want to legalize revenge and you can read the books listed in the syllabus. http://vernunft.org/sites/default/files/syllabi/revenge%20and%20the%20law.pdf