I don’t think Sanders would have done better than Clinton.
Trump and Hillary had historically high unfavourable ratings, and Bernie is quite popular. The socialist label was worn out somewhat on Obama, so it doesn't carry the same sting. He doesn't have anywhere near the baggage that Hillary does, and had policies to address some of the white working class concerns of the rust belt, and shared some of Trump's skepticism about free trade offshoring jobs. He would've gotten all of the "anyone but Trump" votes (as Hillary did), plus he had a bloc of genuinely excited voters who enthusiastically supported him till the end, potentially meaning greater turnout. Not saying he would definitely win, but in head to head polling he did better vs Trump than Hillary did.