Bernie wasn't even a Democrat in name, until last year.

He might have won, but  "Trump would have attacked him in a different way. Most likely, he would have hammered away at Sanders being a wild-eyed communist. Then Sanders would have lost, and we'd be sitting around wishing we'd nominated Clinton." 

"In the end, this is unanswerable. For myself, I doubt that Sanders could have beaten Trump. Once he left the cozy confines of the Democratic primaries, he would have been pilloried."

http://www.motherjones.com/kevin-drum/2016/11/could-bernie-sanders-have-beaten-trump