I'm afraid I can't explain this good because I'm not fully understand about this matter also. But I'm trying (anyone please share your knowledge, and correct me if I'm wrong

)
First of all, yes you are right. When we program under 8086/88 we are fully in control because DOS has no control! But then under windows, this OS takes control over what our program can do and what can't (protection scheme). Yes we can bypassed this protection, but there are rules in order to do that and we simply must follow the rules of the OS (any OS)
Under DOS, all the code in the program is exactly what we type. Under windows, there are other things that the compiler added into the EXE file. Have you ever look at the EXE file for windows using Hex Editor? If you have, you'll see at the beginning of the EXE file an ASCII string mentioned something like this:
This program cannot be run in DOS mode!
That is the EXE header (PE) that is added by the compiler in order to run under Windows OS. The format of this file also known as COFF EXE format file. Or we can also say "Native Windows 32 bit EXE file format".
If MASM compiler doesn't add that header format, you will have to write your own format so the program can be run by windows. Remember windows using a FLAT memory addressing. And always start at ORG 00401000 (virtual address) as an entry point. Can you create it yourself ? Allocate the program into virtual memory address ? and there are other things that have to be done first before the program can actually run. And this is not a simple job
In UNIX OS (other than windows OS), of course that file won't run. Why ? Because maybe they also have their own EXE format, their own rules. Sorry, I don't know what it is, cause I never play around with UNIX. But I hope you get the picture why the portability between OS's becomes an issue.
This is one of the reason why people choose C/C++. It is much easier to switch between OSes. Even in C/C++, have you ever heard about portability issue. ASM will simply be harder to port to another OS.
Regards
-- AirCon --