Even various linux versions aren't compatible with one another. For example, you could install a program on it with e.g. apt-get and one distribution of linux gets the program from one depository, another gets it from another depository, as it should, but there could be differences in the programs. A program like ssh might store configuration files in /etc/ssh or might store it in just /etc you have to find out on your linux system where it is.
And even one linux version depending on how it is configured, a script might not be compatible with both. For example, in Debian(and no doubt not just Debian), the 'mail' command runs one mail program, but can be configured to run another. Different mail programs have different parameters.
And then there's the question of what programs you have installed. If the script accesses a program that isn't installed then it won't work. This applies to cygwin or linux. And it could just be a tiny little program.
And in linux there are different shells. And also a shell could be configured in an unusual way, for example, does
.. or not. Linux opens you to a sea of complexity you clearly have not even imagined.
As to your question of whether to use .bat or .sh well. If you're running in just plain cmd.exe no cygwin then the script would be .bat (though there are other scripts or programs though they may run as a parameter to another program acting as an interpreter) If you were running within cygwin the extension won't change anything.
You should think a bit about how much you want to and can know about a script before using it. If it's a one liner from a website then it's reasonable to know at least something about how it works. Don't run things completely blind. If it's a huge script which is part of a complex program you downloaded, then you might want to look at the script before you run it but you might be ok not understanding everything or much in it. Linux can distract you with complexity, but I wouldn't suggest avoiding the complexity. Asking if 'a' is compatible with 'b' is such a general question you might get a more useful answer if when you're faced with a specific case, make sure you're doing it the right way for your distro or for cygwin. The readme or website you're getting it from or the installation file should say. Each thing can have its own way of doing things.