True, its a crime only if it is defined as a crime. Public officials can do illegal things that cannot be prosecuted, only reversed. The usual prosecutable crime in these cases, as far as I understand it, would be conspiracy to do something illegal.
rigging elections is a crime.