Coconut oil, just the oil, may not have effect on worms, but I can assure you that both coconut milk and fresh made coconut cream from the coconut meat is one of the strongest anti- parasite foods/remedies.
To clarify, coconut milk I'm referring to is the store bought liquid made from pressing the coconut meat. Coconut water, the liquid inside the coconut, I'm not sure about, but it is one of the best 'electrolyte' drinks you can find, especially from fresh coconuts.
I have made fresh coconut cream by juicing raw coconut meat and it is very tasty and a very strong anti-helmthinic remedy- sort of similar in action to eating raw eggs. If you search around for tse tse's raw egg flush people wind up passing tons of worms with this method. That method in itself is just a very watered down version of the primal diet.
You will find that many of the tropical foods are strongly anti-parasitic. Probably because the tropical parasites themselves are very strong.
In general it is best to use whole foods to utilize all of the healing properties of the food.