Generates hydrogen peroxide which is required for the activity of thyroid peroxidase/TPO and lactoperoxidase/LPO (PubMed:15972824). Plays a role in thyroid hormone synthesis. Also required for lactoperoxidase-mediated antimicrobial defense at the surface of mucosa (PubMed:12824283). Synthesizes NAADP from its reduced NAADPH form which promotes Ca(2+) signaling during T cell activation (PubMed:34784249). May have its own peroxidase activity through its N- terminal peroxidase-like domain. {ECO:0000269|PubMed:12824283, ECO:0000269|PubMed:15972824, ECO:0000269|PubMed:34784249}. This is the function of DUOX2 (dual oxidase 2, Ensembl gene identifier ENSG00000140279).