(I believe this question is technically distinct from Can a local variable's memory be accessed outside its scope? because it is C instead of C++.)
I know that in C
It's undefined behavior. It may work on some architectures or operating systems, but don't count on it. An example of where it may work is Linux, with the red zone enabled.