There are a few reasons your dog may attack other dogs. When he comes across another dog he may be feeling scared, feel like his space is being invaded, feel the need to be dominant, over excited, feel like he needs to protect us. If you haven’t established yourself as your dog's ‘pack leader’ it is more likely that your dog will show aggression to other dogs as your dog may feel the need to protect you.
Two dogs fighting
However if you assert yourself as your dog's leader, they will see you as a calm, assertive pack leader and will follow your lead.