3,630. Challah Before vs. After Terumah
Hilchos Bikkurim 6:7
Let’s say that someone makes dough using untithed grain. In such a case, regardless of whether he took challah before or after taking terumah, his actions are effective. If he takes challah first, he may not eat from the dough before taking terumah and terumas maaser. If he takes terumah first, he may not eat from it before taking challah.
Hilchos Bikkurim 6:8
If someone makes a dough intending to feed the resulting bread to an animal, challah need not be taken. If dough is made for dogs but the bread is also eaten by the shepherds, then challah must be taken. Challah need not be taken from a dough made by a non-Jew.