The story
From about 1215. Origin uncertain. The variant ducking stool is a later (from 1597) corruption. The meaning of cuck here may be a long obsolete nursery word for feces, as reflected in Old English cac, defying sound changes as have words like Mama and Papa. The chair was once described as Latin cathedra stercoris; why, though, this punishment should have this name has not been convincingly explained.
Etymology from Wiktionary, CC BY-SA 4.0.