Worming tablets?

Hi! I am 5w pregnant with our first, and have just come home from a weekend away to find my two dogs with worms! I would usually treat them as well as my husband and I but I am not sure if I am able to? Anyone else been in this situation?