They're all shared, sort of. A story variable, e.g. $variable is copied to each new passage. This makes it possible to have a back button that can undo changes to variables.
Temporary variables, like _variable are not copied over, and only exist until the next passage transition.
If you want to create static variables, essentially constants that aren't copied to each new passage and therefore aren't part of the state, you can use the setup object.
<<set $var to 3>>
/% $var will be copied to each new passage or moment %/
<<set _var to 3>>
/% _var will only exist in the current moment %/
<<set setup.var to 3>>
/% setup.var will be three even in past moments navigated to in the history %/
In answer to your question though, story variables are functionally global.