Yes, so long as the worms have no chemicals added to them such as dyes or scents, and as long as they're bred and raised in fertilizer-free and pesticide-free soil, they are fine.

Earth worms/ Night crawlers are one of the most nutritious foods for frogs, and they're easy to digest .