I have realized that such an animal does indeed exist, every compiler that won't delete pre-link created obj-files is one. If one has used no OS-calls these obj files could be booted as an operating system. But one has to place either the .obj's code itself (if it's really tiny) or (more likely) code that will load it, in the boot sector.
If it should load not at boot - but from within Windows - I guess one must arrange for the assembler equivalent of "ORG 100h" to make room for the (theoretical) command line at the benning of it's memory space, making it an MS-DOS .com... Perhaps other X86 systems (OS/2, Linux) will run this kind aswell?
Note that I'm not thinking that the same .com that acts as an OS at one time would also double as an application. An operating system's code beeing run as an application would of course violate the rules of the OS it's beeing run by (unless the code has little power and is of little use as an OS).