There's a long-standing HIG guideline on macOS: the OK button of a dialog should be the rightmost button. To the left of that is typically the Cancel button. Additional buttons are usually on the left side of the dialog. E.g.:
(Note that the command-key equivalents to those buttons only appear while the Command key is being held down, which was the case when I took the screenshot.)
More precisely, the "default" action is right most. It's equivalent to pressing Return or Enter (if the dialog contains a multiline editable text field, Return inserts a new line rather than accepting the dialog). Escape usually activates the next-to-right button.
More than once I've clicked the rightmost button, thinking it was the "OK" button, and lost all the work I did in the dialog.