OK...Cancel or Cancel...OK in a Dialog Window?
In english software OK should be to the left from Cancel. I.e.:
+------+ +--------+
| OK | | Cancel |
+------+ +--------+
For other languages you should follow whatever is commonly used. I wouldn't be suprised if in right-to-left languages OK will be to the right from cancel.
Also if you really care about GUI quality...:
1. Keyboard focus should already be on "OK".
2. User should be able to move between OK and Cancel using TAB. Focus shouldn't get "stuck" on some kind of additional element.
3. All buttons and gui element should have sane tab order. When you're focused on "OK" and press "TAB" you should jump to "Cancel", not to some other useless control.
4. Pressing Escape should trigger "cancel".
5. Closing the window should trigger "Cancel"
6. Pressing "Enter" may be equal to pressing "OK" (some software uses that, and some don't).
7. Buttons should have "accelerators" assigned. I.e. buttons should be labaled Ok (O is underscored) and Cancel (C is underscored), Pressing Alt+O should press "OK", and pressing "Alt+C" should press "Cancel" button.
8. Keyboard accelerators should be properly assigned for all languages your application supports. Pressing Alt+"letter in your language that cannot be used as the first letter of any word" feels weird.
AFAIK, quality GUI follows those guidelines. Forgetting "keyboard accelerator", messing up tab order (IMO) is a sign of sloppiness, and some "power users" will instantly hate you for mistakes like that.
Also, If application is fullscreen, you may consider using following trick - when "OK/Cancel" appears, move mouse cursor in between the buttons (or on top of "OK" button), when window is closed, restore previous position. Note: this is more suitable for fullscreen games, using it in "standard" gui may be annoying.