I don't think the worms can eat their way out, I believe that is just an ongoing myth. Their digestive track is strong enough to take care of most anything, however if the digested insect or whatever is too big then they will just regurgitate it back up to avoid other issues.
But for the outside materials, I'm not 100% on that. But from what I've heard it can be safe, just give whatever you get a thorough cleaning and make sure you don't bring in any harmful insects or things along that line into your frogs habitat.
Like I said, I'm not 100% on that but I have heard people doing so.
But best of luck to ya!
