There are no perfect answers or scenarios. Please take the following as it seems reasonable to you.
Self-defense is acceptable insofar as the intent is to protect life. If an attacker were to come at you, violence would be acceptable to defend your life as long as the intent is not to kill the attacker.
I don't know what to say for the thief scenario, except the same. Remain mindful of your intent. Do not do harm for the sake of attachment, this does worse for your state of mind than to lose that to which you're attached.