And yes, from the same root we also get, via French, douche, as in, douchebag.
Duct and Ducha both come the same Latin root, ductus, “leading”. More on that one another day.
The transformation happened due to the always-fun pattern of the -ct- words in Latin turning into -ch- words in Spanish. Thus, the d-ct in Latin and English maps almost exactly to the d-ch in Spanish.