If they do look like rice than it is tapeworms larve & they can only be passed onto another dog by ingestion, so nothing to worry about there (unless the other dogs ate your dogs poop). It is the safest of internal parasites (just provide adequate food & water), ussually transmitted by ingesting an infected flea or rodent.
If it is another worm than yes they can be transmitted to other dogs through the pads of the feet & whatnot. Your vet will help you out. Good luck!