I'm glad you asked this question. It certainly is intriguing, isn't it? But this idea was foisted onto popular culture by a complete fraud in 1968, Eric von Daniken with his pseudoscientific book Chariots of the Gods.
Fact is, there is no evidence of ancient astronauts or their effects on ancient civilizations, and the notion is highly, highly implausible. The course of history on earth can be reliably explained by wholly earthly means.
You should read that wiki article on the guy, he was outrageous!