the argument and some local variable are stored in the thread. But these are allocated at compile time
That is not correct.
When a thread is started, a stack is associated with that thread. When a thread terminates, that stack will be reclaimed.
For an example of why that cannot be allocated at compile time, imagine a program that prompts the user for a number of threads to start, and then starts that number of threads. There is no way the compiler could allocate storage for the arguments to methods running on that thread, or for local storage associated with that thread.