Dermatitis herpetiformis and celiac disease are both primarily associated with the HLA-DQ (alpha 1*0501, beta 1*02) or the HLA-DQ (alpha 1*03, beta 1*0302) heterodimers.