Nematodes are everywhere. Fish might even carry nematode eggs inside of them from things they have eaten off the bottom of a tank. What's in your mossballs probably aren't nematodes. Might be blackworms or tubifex worms that got loose, or planaria (which come in a variety of shades) or leeches or flukes or some other heinous parasite worm. Planaria are pretty harmless and will eat leftover foodstuff and rotting stuff in the tank--but will also eat fish eggs on the bottom of the tank (or on leaves or wherever the worms can get to them) and they multiply fast and furiously. Some fish will eat them but all of my fish seem to find their taste, ah, not platable (so I have to do regular planaria hunts to keep the population down). Anything parasitic you do not want in with your fish. And, yes, they can sometimes come in via live food (frozen food is supposed to be safe but who really knows--I don't think there is anyone policing the frozen food for fish business and I've seen some weird things in thawed fish foods). Most inverts (including worms and other parasites) will die from fish meds (read the labels, usually they'll say if the med can be tolerated by inverts), planaria will die with enough salt (I think of them as aquatic slugs).