if your fish can get to them, they will eat them. i am serious about the algae fix product though, it never hurt my fish or the plants, but it did kill off some of the snails and definately a ton of worms.
Are you sure it's not Hydra? They will latch on and kill the fish if not treated. I forget the treatment, but research Hydra, and see if that could be it.
leeches though there aren't many parasitic aquarium leeches - these should inch worm along the glass or swim s like in the water
treatment maybe be best with a small film canister or such with a bit of eat/or fish food in and some small hole the parasite can go in through , then manually remove daily
planaria should have some form of head shape and are generally harmless
i cant think of any nematode's that would be free living and visible to the naked eye, broad spectrum wormer woold work there though- levamisol/flubendazol
you need to get a definite id on the invader and then you an be sure you are choosig the rght therapy