Is it against code to have the thermostatic valve outside the wall?
The only way I can see it would be a code issue is that the anti-scald valve is in a unit which could be easily switched out without having to demo the wall. However, I really can't imagine that the code enforcement would limit us all because some very few people would get around the code by installing an expensive valve and then swapping it out after inspection. And presumably all valves on the market which would fit this rough-in do have anti-scald controls.

In my part of the US there is (or was) resistance to mandates on the anti-scald shower valves. So the plumbing inspection procedure had to be changed--they wouldn't issue the final plumbing approval until the wall was tiled. 
Plumbers were roughing in one valve then replacing it with the older style before the wall was tiled. But one plumber told me that the renegades would then just demo the wall after final inspection and put in non approved valves. Some people are really determined to have their own way.