Alan Turing played a pivotal role in breaking the Enigma code during World War II by developing the Bombe machine, which significantly enhanced the ability of the Allies to decipher German military communications, thereby contributing to the Allied victory.