roundworms are contagious to other dogs but they cannot be passed from dog to dog just by being int he same room. However, if the dogs have defecated in the room and there are traces of the stool on the floor there is a chance that the worms can be passed from dog to dog.
Can dogs transmit worms to other dogs?
“Worms can be picked up from your dog's stool and contaminated soil. They can infect other dogs, and in some cases, people can contract certain types of worms. That's one reason it's important that you always carefully clean up your dog's stool.”
Can dogs pass worms to other dogs through saliva?
While worms do not pass through canine saliva, other conditions do. One virus that spreads through dog saliva is rabies.
More useful articles on a similar topic 👇
How do fleas cause worms?Can dogs pass worms to each other?