Allergic diseases are prevalent chronic conditions among children and can lead to significant health and economic issues. It is hypothesized that healthy and high quality diet during pregnancy can prevent the onset of allergic diseases in offspring. This study aimed to investigate the potential relationship between major dietary patterns during pregnancy and allergies in children under one year of age. This case–control study was conducted involving 244 participants (122 mothers of allergic children and 122 healthy controls) who visited pediatricians and allergy outpatient clinics in Khuzestan Province, Iran, between June 2022 and March 2023. Demographic information was recorded using a socio-demographic questionnaire. A food frequency questionnaire was used to identify the foods consumed during pregnancy. Major dietary patterns were extracted using principal component analysis, and the potential relationship between these patterns and childhood allergies was investigated using multivariable logistic regression models. The crude odds ratio (OR) analysis showed that the fourth quartile of "Nut, vegetables, fruits, and protein" dietary pattern was associated with lower occurrence of childhood allergies (OR: 0.214, 95% CI = 0.068–0.679; P trend = 0.211). After adjusting for cofactors in Model 3, this association was still observed in the fourth quartile (OR = 0.108, 95% CI = 0.019–0.613; P trend, 0.001). However, no significant association was observed between "Carbohydrate and cereals" and "Salty" dietary patterns and childhood allergies. The study findings suggest that a maternal dietary pattern rich in nuts, vegetables, and fruits during pregnancy may reduce the risk of allergic diseases in offspring.