Absolutely, it is OK to defend yourself. When the USA was attacked on 9-11, we fired back "with fury", but not indiscriminately. We bombed Taliban military positions, our special forces chased Al Qaeda into the mountains, and our infantry is still conducting raids and searches for the remnants. But we didn't slaughter Taliban prisoners, we didn't execute Afghan farmers, and we didn't bombard or burn down villages and villagers. And that is the difference.
Hmmm, we weren't so accurate when it came to bombing Serbia. And civilian losses in Afghanistan were a real source of concern and embarrassment for us, if I remember correctly. Never mind that, under our watch, several dozen Taliban suffocated to death in container trucks. And we don't (conveniently) count Iraqi civilian deaths.
But, in all fairness, it is not our policy to target civilians, execute prisoners, shoot up a family in a car by trigger-happy and scared young men and women in harms way, but it happens because that's what war does, even if you are careful. My Lai is a perfect example that even the world's leading democracy is subject to man's failings. Can we expect more from others?
No, perhaps not in recent times, but things happen, and we fess up to it loooong afterwards, don't we?