It would not protect him from state or local action, but it would protect him from federal action.
The reason for this is that in the US system all of those executive actions are done as extension of presidential authority, so as president he would be effectively choosing to arrest himself.
Trump COULD arrest and jail himself, but you know, probably wouldn't :)
And to be clear, there's absolutely nothing preventing voters from electing him president while he's sitting in jail, and as president he would then be holding himself and could release himself