The evolutionary and adaptive potential of populations or species facing an emerging infectious disease depends on their genetic diversity in genes, such as the major histocompatibility complex (MHC). In birds, MHC class I deals predominantly with intracellular infections (e.g., viruses) and MHC class II with extracellular infections (e.g., bacteria). Therefore, patterns of MHC I and II diversity may differ between species and across populations of species depending on the relative effect of local and global environmental selective pressures, genetic drift, and gene flow. We hypothesize that high gene flow among populations of Humboldt and Magellanic penguins limits local adaptation in MHC I and MHC II, and signatures of selection differ between markers, locations, and species. We evaluated the MHC I and II diversity using 454 next‐generation sequencing of 100 Humboldt and 75 Magellanic penguins from seven different breeding colonies. Higher genetic diversity was observed in MHC I than MHC II for both species, explained by more than one MHC I loci identified. Large population sizes, high gene flow, and/or similar selection pressures maintain diversity but limit local adaptation in MHC I. A pattern of isolation by distance was observed for MHC II for Humboldt penguin suggesting local adaptation, mainly on the northernmost studied locality. Furthermore, trans‐species alleles were found due to a recent speciation for the genus or convergent evolution. High MHC I and MHC II gene diversity described is extremely advantageous for the long‐term survival of the species.