Yes, it is allowed to modify another thread's thread-local variables.
What thread_local
means for a variable is that the name refers to a different object in each thread, but it doesn't mean the object is private to its thread. If you make the variable known by something other than its name, i.e. its address, then other threads can access it.