For example when you hop on a trampoline sometimes you will be shocked before you even touch the tramp. Does the shock have to pass through the air to get to you or can it work in a vacuum?
Yes, electric discharge will also work in vacuum. Think of vacuum tubes.
However, you will not have the avalance effect of ionized gas like a spark.