All perfect praise be to Allah the Lord of the Worlds. May His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
There are two situations regarding the fish living in polluted water:
First: If the impurity has changed the water in terms of taste, smell or color and consequently changed the taste, smell or color of the fish, then, according to the reliable opinion of the Shafie Madhab, it is disliked to eat the fish until it is moved to pure water to remove any trace of impurity. The evidence on this is that Abdullah ibn Umar narrated: "The Messenger of Allah (PBUH) prohibited eating the animal which feeds on filth and drinking its milk." {Related by Abu Dawoud}.
Moreover, it is stated in the book [Moghni Al-Mohtajj]: "If the meat of cattle or chicken feeding on filth has changed, even a little, then it is forbidden to eat, because it has turned into a noxious thing. This is also the Madhab of Imam Ahmad. Abu Dawoud and others have reported a sound Hadith in which the Messenger of Allah (PBUH) forbade eating the flesh of the animal which feeds on filth, drinking its milk and riding it……."An-Nawawi said: "According to the reliable opinion of the Shafie Madhab, it is disliked to eat the meat of the animal which feeds on filth. This is because the prohibition mentioned in the above Hadith relates to the change that happened to the meat and not the meat itself. This is by analogy to the fact that it is disliked to eat the meat of the animal, which doesn`t feed on filth, because it is rotten or has a bad smell. This is according to the more correct opinion of the Shafie scholars." {Moghni Al-Mohtajj, vol.6/pp.156}.
Second: If the impure water had no effect on the color, smell or taste of the fish, then it isn`t forbidden to eat that fish since, in principle, it is permissible to eat. This is under the condition that it has been scientifically proven that it is harmless since it contains parasites and bacteria that can`t be observed through the normal senses. Narrated [Ibn 'Abbas (RA)]: Allah's Messenger (PBUH) said: "There should neither be harming (of others without cause), nor reciprocating harm (between two parties)." [Realted by Ibn Majah]. And Allah the Almighty Knows Best.