I had a triple bypass operation and I have a dog. He could sense something was wrong and stayed very close to me a lot of the time during recovery, and I didn't get any infections at all. I think you could also say that humans should not make contact, we carry disease too and so where do you draw the line.
I would think having the dog would be good, as long as he's not rubbing his scars on the dog for some reason. ? lol I believe the "infections" we hear about people having after surgery, are normally initially infected during the surgery and the people don't have any side effects from it till a few days or weeks after.
I would be more scared of a big dog jumping on him too early, or jumping of the bed he is on, or him trying to pickup the dog before his sternum (chest bone) is ready for that kind of stuff. He will have to baby his chest bone for awhile.
After 2 weeks he should be really walking a lot. As long as the dog isn't a big dog that is a puller on the leash, I'd think the dog would be great company on the walks. :-)
I'm not a health professional, so keep that in mind, but it sounds a bit like a medical urban legend that has no basis in fact. I am a volunteer in a in a Cardiac hospital, and commonly family dogs are allowed to be visitors with patients who have had bypass. The furry friends have to endure some common paw-washing procedures that we all should do entering a CVCU, and like humans, they are instructed not to sit on the bed. We have canine and feline volunteers who, accompanied by humans, come in the the unit daily. Pets are often the closest friends of patients. I've not ever heard of pets having to submit to pregnancy tests before entering.
I'd not worry about that information a bit. Frankly, it's probably nonsense.