Well, there are various reasons dogs exhibit violent behavior.
Bloodlines do play a major role in your pet's temperaments. If it's immediate ancestors had an aggressive nature, chances are your dog will, too.
An equal share of it also depends on the general way you behave towards it. Harsh disciplinary methods, extreme restriction and such have already proven to grow violent tendencies in a dog.
Much of it has to do with the environment it is brought up in, but dogs are more instinctual than people generally give them credit for. In a threatened situation, the behavioral lines blur and it becomes difficult to predict what the pet might do.