There are a couple of problems you might run into.
The first is that your default shell may be different on different machines or you may be using an obscure shell which isn't available everywhere. Your best bet is to stick to sh or csh. Be sure to start your scripts "#!/bin/sh" or "#!/bin/csh" to alert the OS to which shell you meant to run in.
The second problem is when you use vendor-specific command extensions or variations. For instance, SCO uses "tape status" where Sun uses "mt-f /dev/rmt/0 status" to check your tape drive.
Most commands are the same, however, and the basic shell syntax is too. If you need to write scripts which run on multiple platforms you might occasionally need to branch based on the results of "uname -r" (os name and version) when you use an implementation-specific command.