While technically true, and is, in my opinion, one way to avoid jailing political enemies just to take them off the ballot, there's a reason candidates do a lot of rallies while they're campaigning. If a candidate is actually in jail, they'll legally be on the ballot, but they'll face a very steep uphill battle for the practical needs of a campaign.