1

united-statestexas
It depends.
Generally, self defense is a matter of state law, and states vary. Some states have an exception to self defense when the person is committing a crime.
Example, Texas Penal Code § 9.31
SELF-DEFENSE. (a) Except as provided in Subsection (b), a person is justified ...