Not any OS. i5/OS (formerly OS/400) would be immune as all OS objects are digitally signed and the signatures are evaluated when the objects are loaded/executed (as well as when installed/restored).
Also, program objects, the equivalent of EXEs and DLLs, can't be modified by normal commands or publicly available APIs. Copied & deleted, yes, but changing the contents, no. Program objects can only be manually patched via system service tools, which is a service function that cannot be scripted and has it's own additional layer of authentication that uses a separate ID from the normal system signon. And you need special system authority just to run the command to start service tools.