Only partly. Active noise cancellation (ANC) works best on steady, low-pitched sound such as engine or air-conditioning hum, while human speech changes quickly and spans roughly 80 Hz to 4–5 kHz, which makes it hard for the electronics to predict and cancel in time. Researchers at Aalborg University note that conventional headphone ANC algorithms perform poorly above about 1–1.5 kHz, so voices are usually muffled rather than erased. Much of the reduction you hear on speech, especially the higher-pitched consonant sounds above about 3–4 kHz, actually comes from the passive seal of the ear cups or ear tips, not from the ANC circuit.
Image: Bose QuietComfort 25 headphones (photo by Florian Fuchs, CC BY-SA 3.0), via Wikimedia Commons.