In 1980, John Anderson was briefly a viable third party presidential candidate so it made sense that Marvel would follow with a storyline in which a group of activist attempt to convince Captain America to make a third party bid of his own. Ultimately, Cap turned down their offer.
A later issue of What If… revealed that, if Captain America had run, he would have easily been elected President. Then, he would have been assassinated because every issue of What If… ended with everyone dead. It’s a good thing he didn’t run.
Could Captain America win the election if he ran today? As an unwoke fictional character whose costume would be considered triggering, it might be difficult for him to do so. Still, who better to make America great than America himself?