The myth of the Great Deluge is one of the most widespread and ancient myths of all. (This is about as old school as it gets, folks.) The earliest versions that we have come from ancient Sumeria where epics like The Epic of Gilgamesh tell of a great flood sent by the gods to destroy mankind. Just like in the Greek version of the myth, starring Deucalion and his wife Pyrrha, this oldest version features a dude who builds a boat to survive the flood and is thus able to reignite all of humanity.
The story of Noah and the Ark, which appears in Jewish, Islamic, and Christian tradition is, of course, pretty similar as well, and there's also a version from Hindu culture, starring a hero named Manu. It doesn't stop there either. Many many cultures the world over have some form of flood myth.
So, what gives? If pretty much every major world religion and every culture has some version of a flood myth, it's highly likely that some version of it must've happened, right? There's no knowing for sure, but a ton of scientists have put in time trying to figure out where the story might've come from. Their theories range from a giant comet crashing into the ocean, to melting Ice Age glaciers. Who knows if we'll ever figure out the inspiration for the myth of the Great Deuluge, until then we'll just have to enjoy the literary versions that pop up in the works of Ovid and Apollodorus among others.