Both. If you deal with a value type (struct or primitive) and never take the address of it, it can't exist anywhere besides the current stack, value types are copied if you return it out of a function or call another function with it.
For reference types, they do have escape analysis, not sure how one would compare it to another language.