There is nothing wrong with a chicken eating maggots per say. However some maggots may have picked up "things" from any carrion that the maggots have been feeding on.
For that reason I don't encourage feeding maggots. However meal worms resemble maggots and from your description of where you...