I know in the Japanese version of the PS4 by default that its:
- X: キャンセル / 戻る [Cancel / Back]
- O: 選択 / 確認 [Select / Confirm]
While in most consoles globally: the X button is used to select or confirm something while the O button is for cancel, basically the sequences are inverted. I know this because I’ve played games on a Japanese PS, even in GTA V (the imputs for either button have been adjusted on that version).


As others have already mentioned:
Another point to consider is that Japanese is typically read from right-to-left, so the ‘first’ button is O. See also: Nintendo controllers, which still use ABXY in a ‘backwards’ arrangement, with A on the right.
As for why western developers decided to flip the controls? No idea who started it or why, but it’s become the global convention. That said, I remember a lot of PS1 games using triangle as the back button.