Lungworm isn't contagious and able to be caught by humans from their dogs but there is another worm called roundworm that both dogs and cats carry which humans can be infected by.
The roundworm can cause serious diseases in humans when they're in contact with dogs or cats that are infected with the roundworm.