Background The coronavirus disease 2019 (COVID-19) is an infectious disease, caused by the new coronavirus known as Severe Acute Respiratory Syndrome Coronavirus 2 (SARS-CoV-2), and exhibits diverse clinical outcomes and symptoms in infected individuals, emphasizing the need to investigate how human genetic diversity influences the virus’s impact. This study aims to employ in silico methods to identify epitopes capable of eliciting an immune response, focusing on the most prevalent HLA-I and HLA-II alleles in the Moroccan population. Methods Our research consisted in predicting peptide-binding affinities between the most prevalent HLA Class I and Class II alleles in the Moroccan population and SARS-CoV-2 spike glycoprotein (S protein) peptides of variants isolated from strains of Moroccan patients. We performed the same analyses for SARS-CoV-2 wild type S protein to assess the ability of these HLA alleles to interact with peptides in the presence or absence of SARS-CoV-2 mutations. Results In a broader sense, 12 distinct HLA Class I and Class II alleles in the Moroccan population have been identified as possibly interacting with 19 epitopes in the SARS-CoV-2 S protein. Findings of this study must be validated in both in vitro and in vivo models. Conclusions These data may help clarify the issue of host cell susceptibility and the outcome of SARS-CoV-2 infection, and may guide further research to uncover potential targets for the vaccination strategy.