So the Police Chief or Sheriff can not be prosecuted until removed from office? Sheriffs in particular are elected (in most places).
And what of Governors? They are the Executive of a state, are they immune from prosecution under state statutes for unofficial acts, must they be removed from office prior to prosecution?
This "doctrine" is not found in law, only judicial custom.
A sheriff or police chief will not arrest himself, but there are higher authorities to prosecute a sheriff or police chief. And governors have often been prosecuted by federal authorities.
But the president is in a unique position. Federal law is the supreme law of the land, and the power to enforce the law is vested in the person of the president. There is no higher law enforcement person with the power to arrest and prosecute the president (other than Congress using its constitutional power).