First, to be sure of the type of worm, it's difficult without photos.
Leeches and planarias can be interested in amphibian eggs, especially if the jelly coat is thin.
In Europe, some leeches will eat eggs, other wont. All planarias seemingly can feed on eggs.
Hydras are also commonly introduced with wild caught daphnias or with plants, but they are not dangerous for eggs.