Maybe. Black walnut has been used for that, but it's never been scientifically tested to see if it actually works. It's also known to cause stomach upset and diarrhea, and due to the high tannin content found in black walnut, may cause liver or kidney damage and may result in some types of oral, nasal, or esophageal cancers. Don't risk yourself to get rid of a worm. See a doctor for something safer.
No. Black walnut worm is not a treatment for babesia (a “piroplasm, ” that infects red blood cells, carried by ticks)