Yes worms can be passed onto humans from dogs if the dog licked their anus and the dog has worms and then they lick the humans face then the bacteria can be transferred to the human through oral contact.
If you know your dog has worms do not allow them to lick you or anyone at all until the worms have gone away.