The first perek of Massekhet Bekhorot focuses on the laws of a firstborn donkey, which must be exchanged for a lamb and given to the kohen (see Shemot 13:13, 34:20). Even though we might expect that the tractate should begin with the laws of the firstborn of a kosher animal that has intrinsic sanctity and is brought as a sacrifice, the Gemara explains that the laws of the firstborn donkey are short and relatively uncomplicated, and by placing them first, the other cases can be discussed at greater length without interruption.
The first Mishna discusses how non-Jewish ownership of a donkey would affect this law, teaching that the emphasis of the Torah on the Israelite in the context of these laws (see Bamidbar 3:13) frees such animals from the requirements of bekhor. Thus, someone who purchases a firstling from a non-Jew prior to its birth does not need to redeem it with a lamb. This halakha would also be true in a case where the fetus is sold to a non-Jew, although the Mishna comments that it is forbidden to make such a sale.
Why would selling such an animal to a non-Jew be forbidden?
Tosafot suggest that the prohibition stems from the fact that such an animal loses its potential sanctity. Rashi argues that this is the ordinary prohibition of selling animals to non-Jews, whose source is the fact that the animal will need to work on Shabbat, and Jews are obligated to allow their animals to rest on that day (see Devarim 5:13 and the Gemara in Massekhet Avoda Zara, daf 14-15).
The Gemara in Avoda Zara asks why this should be a problem, after all, once the animal is sold to a non-Jew, surely the former owner cannot still be required to ensure that the animal rests on Shabbat!? The Gemara explains that this is a Rabbinic injunction lest the Jew rent or lend the animal to a non-Jew. In his Meromei Sadeh, the Netziv points out that according to Rashi, our Gemara does not view this as an injunction, but sees a basic problem with a Jew lowering the level of sanctity of an animal who will no longer rest on Shabbat.