I'm sure beavers and muskrats can carry viruses, but you're probably thinking of Giardia, a flagellated protozoan parasite which causes giardiasis, also known as "beaver fever".
We've had beavers in our pond several times, but, after they cut down all the trees, they moved elsewhere.
Short of killing the critters whenever they show up, or totally draining the pond, the only other way I can think of would be to make the face of the dam unattractive to muskrats by, say, covering it with stones/ rip-rap or whatever. Shooting them is likely easier and a lot cheaper to do, though. In the short term, though you also could try pitching a few moth balls into their dens. That might chase them out; at the very least, they wouldn't have moth-eaten pelts when the trapper finally gets them.
BOB