I think the only way to prevent violence is to struggle each generation to teach children that violence is not a good thing while also training them to defensively fight if they have to against others who start violence. But the #1 priority should be teaching that violence is terrible. Social shunning is a powerful force; if groups of people socially shun anyone who commits violence, that may be enough, but it requires a very, very, very strong societal ethic and official societal mores, ideology and self-identity that civilized society shuns violence.