I have injected hornworms and silkworms with baytril and then fed the worm. I don't know if you can do that with dewormer, but I am assuming so. Hopefully someone else can answer that question for you!! If you can, that is the way to go to get meds in them.
What I do when i'm giving my guy the d3 I got from the vet(Yes, been doing it about 2 weeks) is i'm using a syringe and inject into the 2 crickets then feeding him with it, so I guess you should be fine doing the same thing into worms or w/e you want to use. But to be sure, call your vet and ask. My guy went all crazy and puffed up and went to hide when I came with syringe(with out the needle ofc)