Epithelial human blood group antigens (HBGAs) on O-glycans play roles in pathogen binding and the initiation of infection, while similar structures on secretory mucins exert protective functions. These double-faced features of O-glycans in infection and innate immunity are reviewed based on two instructive examples of bacterial and viral pathogens. Helicobacter pylori represents a class 1 carcinogen in the human stomach. By expressing blood group antigen-binding adhesin (BabA) and LabA adhesins that bind to Lewis-b and LacdiNAc, respectively, H. pylori colocalizes with the mucin MUC5AC in gastric surface epithelia, but not with MUC6, which is cosecreted with trefoil factor family 2 (TFF2) by deep gastric glands. Both components of the glandular secretome are concertedly up-regulated upon infection. While MUC6 expresses GlcNAc-capped glycans as natural antibiotics for H. pylori growth control, TFF2 may function as a probiotic lectin. In viral infection human noroviruses of the GII genogroup interact with HBGAs via their major capsid protein, VP1. HBGAs on human milk oligosaccharides (HMOs) may exert protective functions by binding to the P2 domain pocket on the capsid. We discuss structural details of the P2 carbohydrate-binding pocket in interaction with blood group H/Lewis-b HMOs and fucoidan-derived oligofucoses as effective interactors for the most prevalent norovirus strains, GII.4 and GII.17.