It depends on what you are calling "a foundling". Several cases are exposed in Gemara and Poskim relating to where and how the child was found. The Asufi of the Mishna has several possible statuses: Mamzer (bastard), Goy (gentile), etc.
The Mishna in the 4th perek (chapter) of Kiddushin, Mishnayot 1-3, Daf (folio) 74a, follows Rabbi Eliezer, and Rambam rules accordingly:
כיצד שתוקים ואסופים וספק ממזרים אסורים לבוא זה עם זה ואם נשאו לא יקיימו אלא יוציאו בגט והולד ספק כאבותיו. ואין לספיקות אלו תקנה אלא שישאו מן הגרים והולד הולך אחר הפגום:
They would marry a gioret (convert), who is also prohibited for a Kohen. You see that there is no Chashash Kohen and Challalut (no fear of being Kohen or unfit offspring of Kohen). The prohibition added by Rabbi Eliezer is because he thinks that the "Maala Asu Beyochasin" (the sages' stringencies on pedigree), while efforts to avoid marriage with a Safek Mamzerim (possible bastards), exist even for other Sfekot (people of uncertain pedigree). There are many Mishnayot in Masechet Yebamot concerning Safek Kohanim (possible Kohens), e.g. when babies of Jewish women are mixed, where all Chumrot (stringencies) of Kohen are applied to the Sfekot. See Yebamot Mishna 11, 5.
On Daf 73a, according to the Chachamim, the Gemara asks about Asufi and Asufit (male and female foundlings), e.g. what about possible siblings. It concludes that this is not a frequent occurrence. You can ask; If he is a Kohen and she is a Kutit (Cutheans – today considered gentiles) or other Psuls (pedigree disqualifications). However, the prohibition against marrying Mamzerim is not a prohibition according to the Rabanan (the sages – who differed from Rabbi Eliezer), so Kal Vachomer (a fortiori) regarding Kehuna and Isure Kehuna (those that Kohanim are prohibited from marrying). According to the Rabanan, the Kehuna (priesthood) is not a problem, and Rabbi Eliezer agrees.
See Bet Shmuel E.H 4, sk 54 for an extensive explanation which combines all Sfekot. I will Bli Neder (though without promising anything) summarize it further soon.