A red heifer that was born via C-section, or that was used as the wages of a prostitute or the price of a dog, is invalid. Rabbi Eliezer says that it is valid, as per Deuteronomy 23:19, “You shall not bring the wages of a prostitute or the price of a dog into the House of Hashem your God,” and this isn’t brought into the Sanctuary of the Temple. All blemishes that invalidate consecrated animals also invalidate the red heifer. If one rode on it, leaned on it, hung onto its tail, crossed a river assisted by it, doubled up its rein onto it or put his cloak on it, it is invalid. If he tied it up by its rein, made a sandal for it to keep it from slipping, or spread his cloak over it because of flies, it is valid. The general principle is that if anything is done for the cow’s sake, it remains valid; if it’s done for another’s sake, the cow is rendered invalid.
If a bird rested on the cow, it remains valid. If a male mounted it, it is rendered invalid. Rabbi Yehuda says that if the male was made to mount by the owner, the cow becomes invalid but if it did so on its own, the cow remains valid.