That gets to a different point beyond winning a general election. There are two new questions: Do dark horses have a better chance of winning a general election? Do we know if dark horses who lost primaries would have performed differently in the general election.
Zauriel listed dark horses who became President. He didn't really address dark horses who won primaries but lost the general election.
In 1940, Republicans nominated businessman Wendell Wilkie. He was a dark horse. He didn't run a formal primary campaign.
In 1944 and 1948, Republicans nominated New York Governor Tom Dewey. Not a dark horse.
In 1952 and 1956, Democrats nominated establishment favorite former Illinois Governor Adlai Stevenson, grandson of a former vice president. Nor a dark horse.
In 1960, Republicans nominated Vice President Richard Nixon. Not a dark horse.
In 1964, Republicans nominated conservative favorite Barry Goldwater. For our purposes, he's dark horse.
In 1968, Democrats nominated Vice President Hubert Humphrey. Not a dark horse.
In 1972, Democrats nominated progressive favorite George McGovern. He's essentially their Goldwater.
In 1984, Democrats nominated former Vice President Walter Mondale. Not a dark horse.
In 1988, Democrats nominated Dukakis after the frontrunner had a sex scandal. Dark horse.
In 1996, Republicans nominated Senate Majority Leader Bob Dole, the next line. Not a dark horse.
In 2000, Democrats nominated Vice President Al Gore. Not a dark horse.
In 2004, Democrats nominated an establishment favorite Senator in a field without a clear frontrunner. Probably not a dark horse.
In 2008, Republicans nominated a prominent senator who had finished second in the previous primary. Probably not a dark horse.
In 2012, Republicans nominated a prominent former governor who had finished second in the previous primary. Probably not a dark horse.
In 2016, Democrats nominated a former first lady and secretary of state who had finished second in the previous primary. Not a dark horse.
There seem to be three dark horses among the losers, compared to a dozen establishment favorites, two were allowed to run again. Dark horses may seem to have a better batting average among winners, although an overlooked question is how political parties behave in elections when they're not favored to win. Republicans should have won 2016, so Trump's win isn't that impressive. Fundamentals were good for the incumbent in 1964 and 1972, so a more generic challenger wouldn't have lost, although the extent of the defeat might not be as significant.