Yes you can get worms from your dog.
A type of worm called roundworm is easily transferable to humans from dogs through the dogs feces.
If you touch the dogs feces and fail to wash your hands or you step barefoot in a dogs feces then you could get the roundworms from the dogs feces.
So make sure you wear gloves and try to avoid stepping in any dog poop.
Immediately wash any dog poop off your foot or shoes etc.
Most other types of worms that dogs have cannot be easily passed to humans but some can.
Just be very careful around your dog if they do have worms and get the dog de worming medicine if they do have worms.