If someone is attacking you to kill you should you defend yourself? Would it be ethical to kill an intruder coming into your home? If not, how did the bushido samauri warriors justify it? We're they wrong?
I think yes, you may. Our religion has never stopped us from doing that.
you may stop an intruder forcefully. Our religion has never stopped us from doing that.
But for me, being Buddhist, the answer will not end there. Both (two above lines) questions are based on teaching of Ahimsa (not to injure). If it is so then it is important to know how we interpret this teaching. Following are some of the points we can consider-
These are the points in short based on which I said you can physically defend and you are not stopped by Buddhism from doing so. I don't want to say that you should (or even you can) kill. But you may defend. Dr. Ambedkar's discussion on Ahimsa is very enlightening in this regard. You can find it here -The Buddha and His Dhamma, Book 4, Part II, Section 3. It is a good read and the best part is it covers the whole debate in two pages. I also found this article interesting discussing the same point.
I think there are two question here with different answers
1. Should a Buddhist defend themselves physically
I would argue not. I believe that Buddhist teaches radical pacifism. The first precept explicitly states
Which points to non-violence. The Kakacupama Sutta: The Parable of the Saw in the Pali Canon goes further
So even if you are being rendered limb from limb, one should still not practice violence. In a more modern day setting, I read of Tibetan monks held and tortured by Chinese officials whose greatest concern was that they would lose the capacity for compassion towards their tormentors. The compassion response is still possible even under such extreme circumstances.
2. Can Buddhism be ever used to justify violence
Yes unfortunately it can. To give an example the Tibetan Kalachakra Tantra has got anti-Islamic passages in it which can be used as a justification for violence
Also some Japanese Zen Buddhists were supportive of the second world war which is closest to your samurai point. This article gives more detail on this point which I won't copy through here. One quote from Harada Daiun Sogaku is illustrative
So just to summarise the answer, Buddhism is vast, so it's unsurprising that some group, determined enough, can dig out something to justify violence. However the overwhelming majority of the texts and practices say precisely the opposite.
In ancient China, areas were just plain dangerous to be on account of banditry and so on. This fact even showed up in the Brahma Net Sutra and the Upasaka Precepts.
So the first part of the rule was to avoid getting into situation that called for defense.
Shoot, I have to unwrite what I just wrote-- as it turns out, the origins of the Shaolin (Chan) monks and Kung Fu are sort of lost to time. We don't really know if Buddhist martial arts came about because a monastery was a big institution and estate that eventually sprouted warrior monks, like ones in Japan did, or if monks needed to defend themselves in a way that was consistent with their values, i.e. unarmed combat and doing as little damage as possible to your enemy. Or maybe the martial arts were a side effect of austere exercises, like standing in horse stance for hours, which created very strong legs and made it literally hard to push monks around.
Anyhow, if one is looking for inspiration for how to defend oneself while remaining consistent with your value system-- then I think Judo and Aikido seem to be the best example of applying the Buddhist ideal of ahimsa to self defense (although I'm not sure that they are explicitly related to Buddhism anymore)
Oh this question has a part 2-- How do lay Buddhist soldiers justify their actions? Well it's easier than the monastic soldiers (they did exist!)-- the monastics took vows, the lay Buddhist soldiers did not**. Lay Buddhist soldiers were more likely practice a devotional Buddhism, where you seek this and after worldly support from celestial Buddhas and Bodhisattvas. In that system, if you are good enough, you are reborn in a Pureland where you don't have to made difficult decisions about if you should let a bandit walk all over you, if you should let the local Shogun draft you into an unfair and unjust battle, or other quandaries. Once one is in a Pure Land, you can practice more conventional morality and reach enlightenment.
Anyhow, even in modern times in things like an informal book club, you quickly learn that often times people are not participating in Buddhism because they want to follow the precepts-- they are there for other reasons, family tradition, for the benefits of meditation, and so on. So there isn't a strong cause to call hypocrisy if they on lay Buddhists who happen to work as Samurai. (Warrior monks is a different story altogether)
** Even when lay followers take the 5 precepts, they aren't expected to follow them with the rigor that monastics are expected to as the rules on sex make clear-- no sex at all for monks, no impropriety for lay followers. So I imagine a solider shouldn't kill in a socially unacceptable manner, while a monk is trying not to kill anything, or at least not be involved in socially unacceptable killing.
In Buddhism the idea is preserving and guarding the mind is more important then preserving the body because the body is viewed as impermanent therefor one should not cling to it. If one take up arms in defense of the body there by killing or harming another being, then the mind becomes impure and one can not reach enlightenment.