This answer is simplistic, but it tries to give an idea. Imagine that programs are a list of requests to do something.
Just like in a restaurant where Voce makes the order informing that either well-done, with or without onions, ..., this is just the order (your program). Who will actually prepare the dish (the operating system kernel) is in the kitchen tries to prepare according to your request (the program).
You’ll only eat what you want if you say the same about the cook.
The linux cook speaks ELF and the windows one speaks PE. So usually one does not understand the requests made to the other.
But there are some who are bilingual and can understand other formats. A very cool project is the Wine running windows on linux (sometimes performing better than windows itself).
So it’s just a matter of understanding the language to communicate with the operating system.
Here is a link to some executable format types (in Spanish, but I think you can get an idea that has a lot)
https://stackoverflow.com/questions/32117572/why-does-a-linux-compiled-program-not-work-on-windows
– gfleck
I understood, but well that someone could answer in Portuguese to help the popular Brazilian version of Stackoverflow
– silash35