Yes, you can be elected president if you’ve been charged with or convicted of a crime

The eligibility requirements for president are outlined in the Constitution and don't exclude anyone with a criminal conviction or indictment.