Yes, a convicted felon can run for president and some have. Others have ran for lesser offices and WON while serving time.
More tricky to say that a president can avoid indictment (see Clinton) while in office. Their official immunity has to be tied to them official duties in office. Why do you think the official reframe from the Clinton camp was that he wanted to get back to the work of the people.
Impeachment is a political act in response to an ambiguous set of charges (high crimes and misdemeanors): treason would certainly be one, murder another, but over the years various charges like lying to the public and using the IRS for political purposes have been added to the list. We also have suborning perjury, perjury, and witness tampering. Punishment upon conviction can range from an official censure or removal from office.