James Cameron and Gale Anne Hurd
A merciless, bullet-proof cyborg sent from the future with the sole purpose of killing you? That's a scary idea. It's being-caught-in-class-wearing-nothing-but-your-underwear–level scary. So it makes sense that The Terminator had its origins in a nightmare—or, as screenwriter James Cameron referred to it, a "business assist."
It all started in the early 1980s. Cameron was in Italy trying to get his name off his directorial debut, Piranha II: The Spawning. Long story short: he was fired after five days of work, and he didn't want his name associated with the finished product. For legal reasons, he is still credited as the director to this day.
As if being held responsible for something named Piranha II: The Spawning weren't bad enough, Cameron grew sick and developed a high fever. In a fevered dream, he saw a "metal death figure coming out of a fire. And the implication was that it had been stripped of its skin by the fire and exposed for what it really was" (source).
He shared his nightmare with Gale Anne Hurd, assistant to Roger "Boss of the B-Flick" Corman, under whom Cameron had also worked as a model-maker. Together, they developed the idea. Cameron wrote a script treatment while bouncing ideas off Hurd, who made suggestions. After shopping it around town, they eventually convinced Orion Pictures to agree to distribute.
Unlike many films, where the screenwriter loses creative control to the director and producers, Cameron would stay on to direct, meaning he shot the movie he came up with at the script level. According to him, the script wasn't changed at all: every line of dialogue remained intact.
But Cameron did note that the original concept morphed as things went along, especially once Arnold Schwarzenegger was hired to play the title character:
The visual concept was that […] just one face in a crowd could walk up and kill you for no apparent reason, except for what your life would mean in some future time. And that concept changed because Arnold doesn't vanish into a crowd. It took on a slightly more hyperbolic visual style. It was a little larger than life. (Source)
That conceptual change seems to have worked rather well. Schwarzenegger went on to become of the most recognizable actors of the '80s and '90s, and Cameron went on to write scripts with even fewer characters that blend into crowds (in particular that one with all the blue cat-Smurf hybrid folk).
All in all, it wasn't a bad way to turn a nightmare into a business asset. Now if we could only figure out a way to write that story about our recurring underwear nightmare, we'd be gold.