Dogs, like humans, show a wide range of tolerance for others. Some are immediately friendly with every new dog, cat or lizard. Others are forever hostile to even the opposite sex of their own breed. Considering dogs are by nature territorial the diversity is odd, but there it is.
Naturally, animal lovers like to have more than one dog around and often several breeds or other species. Ensuring that chairs remain upright and necks unbitten can be a real challenge. Add to the mix the neighbor's pets or random critters who wander into your companion's territory and your furniture, not to mention your sanity, can be at real risk.
The first step is to start the process of socializing your dog as early as possible. Like children, puppies are much more accepting of strangers. They haven't yet distinguished between friend and foe and everything is a new experience to be explored rather than feared or chased.
If you have only one dog, expose the puppy early on to other dogs and people. Get them used to being touched, especially between the toes, in the ears and near the eyes. Apart from impact on interaction with animals, that will make vet visits and trips to the store a lot easier.
Dogs, of course, sniff everything. When they're about to interact with another, control them until you're confident there won't be chasing or violence, then let them explore the other dog, cat or creature.
If the dog shows a tendency to leap or bite, tolerate it to the point someone is going to get injured. It's normal for dogs to rough house, knock one another over and even lightly bite legs and necks. Stay close and be prepared to snatch them away, if necessary. Leather gloves may be useful during the initial experiments.
If they continually bark, distract them with a treat, a toy or a sharp command. If they refuse to cease pulling or barking after several attempts at control, try another day. What works will vary widely depending on the individual dog and some will simply never tolerate others. You'll discover what's more and less effective as you observe their interactions over time.
It may be necessary to put the dog on it's back, then hold it down with a firm hand on the chest. In harder cases a bark or shout in the dog's face is useful. Yes, you will look like a lunatic to others, but this technique is even employed by the Monks of New Skeet. The brothers of this upper New York State religious order are world-renown for their German Shepherd raising practices.
Rescued or animal shelter dogs can require extra patience when socializing. These animals have often been abused by people or injured by other dogs. Those experiences naturally often lead to aggression or fear. Remarkable transformations have been seen even in these dogs, though. After repeated exposure they often learn to at least tolerate other people and pets.
Start early, expose for short intervals leading to longer ones, repeat as needed. In every case, be prepared to physically and mentally control the dog.