Diabetes is not a single and homogeneous disease, but a cluster of metabolic diseases characterized by the common feature of hyperglycemia. The pathogenesis of type 1 diabetes (T1D) and type 2 diabetes (T2D) (and all other intermediate forms of diabetes) involves the immune system, in terms of inflammation and autoimmunity. The past decades have seen an increase in all types of diabetes, accompanied by changes in eating habits and consequently a structural evolution of gut microbiota. It is likely that all these events could be related and that gut microbiota alterations might be involved in the immunomodulation of diabetes. Thus, gut microbiota seems to have a direct, even causative role in mediating connections between the environment, food intake, and chronic disease. As many conditions that increase the risk of diabetes modulate gut microbiota composition, it is likely that immune-mediated reactions, induced by alterations in the composition of the microbiota, can act as facilitators for the onset of diabetes in predisposed subjects. In this review, we summarize recent evidence in the field of gut microbiota and the role of the latter in modulating the immune reactions involved in the pathogenesis of diabetes.