As a global focus of animal husbandry, pigs provide essential meat resources for humans. Therefore, analyzing the genetic basis of adaptability, domestication, and artificial selection in pigs will contribute to further breeding. This study performed a genome-wide selection sweep analysis to identify candidate genes related to domestication and adaptive selection via data from 2413 public genotypes. Two complementary statistical analyses, FST (fixation index) and XP–EHH (cross–population extended haplotype homozygosity) were applied. The results revealed that numerous candidate genes were associated with high-altitude adaptability (e.g., SIRPA, FRS2, and GRIN2B) and habitat temperature adaptability (e.g., MITF, PI3KC2A, and FRS2). In addition, candidate genes related to the domestic genetic imprint of indigenous pigs (e.g., TNR, NOCT, and SPATA5) and strong artificial selection pressure in commercial breeds (e.g., ITPR2, HSD17B12, and UGP2) were identified in this study. Specifically, some MHC–related genes (e.g., ZRTB12, TRIM26, and C7H6orf15) were also under selection during domestication and artificial selection. Additionally, a phylogenetic comparative analysis revealed that the genetic divergence between populations does not fully follow the geographical distribution and management history in the major histocompatibility complex region/major histocompatibility complex II haplotypes, unlike that of the genome-wide genotypes. Furthermore, the higher heterozygosity and haplotype alleles of MHC reduce the differences between populations. Briefly, this study not only helps promote the relative theoretical understanding of environmental adaptive selection and domestication but also provides a theoretical reference for disease-resistant breeding in pigs.