Depends on the type of worm but for tapeworms you'll usually see little individual segments of worms and not a whole worm but for other worms they'll look like any other worm but be smaller in size.
There's also a chance that a dog could have maggots in their poop that look like worms but the maggots get into the poop after your dog has pooped and the maggots weren't in your dog when they pooped.
The maggots were laid in the poop once it was on the ground.