"This depends on the program itself; the operating system doesn't dictate whether or not order matters.
GCC's set of options is so colossal that I can't say with any authority if you can supply any option in arbitrary order; you'll have to read the documentation for that option. That said, a general rule of thumb is that if you have two or more mutually exclusive options (such as -O1 -O2 for differing levels of optimisation), programs will generally take later options over earlier ones. Again, this isn't enforced by linux.
A simple program that does let you specify most options in any order would be ls. Listing all files in the current directory with detail can be done with either ls -la, ls -al or ls -l -a. However, ls -l1 (that is 'el' 'one') does not give the same output as ls -1l ('one' 'l'). These are mutually exclusive options, and the last listed over rides the first given.
There is also the odd program which applies options to arguments as they arrive. So, for example, you might have a hypothetical command blah -a 1 2 -b 3 where -a applies to all three arguments, but -b only applies to 3.
Again, this is up to the individual program in question. If you're ever unsure, read the documentation."