The Mishna says that an animal that nurses from a treifa mother is forbidden to be used as a korban. The gemara qualifies that it cannot mean that animal that gained a few pounds by eating non-kosher food becomes assur. The gemara explains that we are speaking about an animal that nurses daily from a treifa animal an amount that is sufficient to sustain it entirely, therefore even if the animal eats other things, it is forbidden to be brought as a korban.
The Mishna implies that an animal sustained primarily from issur food is forbidden as a korban, but permitted to be shechted and eaten. However, Tosafos writes - ולפום ריהטא אפילו להדיוט, meaning that it seems it would be forbidden even for a regular person to eat. The Rama in Shulchan Aruch (Y.D. 60:1) follows Tosafos and writes an animal that ate non-kosher is permitted, but אם לא נתפטמה כל ימיה רק בדברים אסורים אסורה - if it only ate issur it's entire life, it becomes forbidden. The Pischei Teshuva cites the Levushei Sered who suggests that this is a fixable problem. If one were to feed the animal kosher foods for a few days, it would lose it's status as an animal that was raised it's entire life on non-kosher foods.
The difficulty with both Tosafos and the Rama is that the mishna implies that this is a problems specifically for korbanos. If this were an issue with even chulin animals forbidding them to be eaten, why would this halacha be said in the context of korbanos? The Gr"a deals with this question and suggests that the Mishna and Gemara are speaking about an animal that primarily is sustained by forbidden food (such as milk from a treifa) but throughout the course of the day will also eat other things. In that circumstance it is forbidden for a korban since the non-kosher milk is sufficient to sustain the animal without any other food, but is not forbidden to be eaten. The Rama is speaking about an animal that ONLY ate non-kosher foods and then becomes forbidden even for a regular person so shecht ant eat it. According to the Gr"a it would seem that that one can certainly do as the Levushei Sered suggests, to feed the animal kosher food for a couple of days and then shecht it to eat.