Dogs are friendly, lovable best friends. They don’t want to hurt anyone! So how do movies get dogs to attack people? With visual effects. A special effects team basically creates a digital double of a real dog and then makes it so that the CG-created dog attacks the actor in the way that the movie wants. In this VFX reel of German movie Look Who’s Back, it shows how that whole process works.
Bonus points: you get to see Hitler pretend a dog is biting his leg.