Praise be to Allaah.
If the manufactured food or medicines did not contain anything harmful or impure (najis), there is nothing wrong with eating chickens to whom they were fed, if they have been slaughtered in the proper shar‘i manner by a Muslim or a kitaabi (i.e., Jew or Christian).
But if the feed or medicine is harmful to man, and will make him sick, for example, it is haraam to feed them to chickens and to eat those chickens, because Allah says (interpretation of the meaning):
“and do not throw yourselves into destruction”
And the Prophet (blessings and peace of Allah be upon him) said: “There should be neither harming not reciprocating harm.” Narrated by Ibn Maajah (2431) and classed as saheeh by al-Albaani in Irwa’ al-Ghaleel (896).
If the feed is naajis (impure), such as meat from animals that died without being slaughtered properly (maytah) or blood and so on, that may be put in the feed, then the matter is subject to further discussion.
Is most of the feed is made from those impure substances or from taahir (pure) things such as grains and the like?
If most of the feed is pure, it is permissible to eat it, and there is nothing wrong with that.
But if most of its feed is naajis (impure) -- this is what the scholars call “an animal that feeds on filth” -- it is not permissible to eat unless it has been detained and fed with taahir food that will make its meat good.
Shaykh Ibn ‘Uthaymeen said in al-Sharh al-Mumti‘ (11/298):
The animal that feeds on filth is one whose food is mostly impure (najaasah).
There are two scholarly views concerning this: one view is that it is haraam because it has been nourished by impure matter that has an effect on its meat.
The other view is that it is halaal. This is based on the idea that impure things become pure when they undergo a transformation. They said: The impurity that it ate has been transformed into blood, flesh and the like that grows in the body, so it is taahir. End quote.
Shaykh al-Islam Ibn Taymiyah said:
The Prophet (blessings and peace of Allah be upon him) forbade the milk of an animal that feeds on filth or impurity, but if the animal is detained until it becomes pure, then it is halaal according to Muslim consensus, because before that the effect of the impurity could be seen in its milk, eggs and sweat, so it gave off a rotten and evil stench. Once that is removed, it becomes taahir (pure). If the ruling is established for a reason, it ceases to apply once that reason is no longer present. End quote.
Majmoo‘ al-Fataawa, 21/618
And Allah knows best.