EDIT in response to question update
To exchange ESC (well 'escape') and C-g in both GUI and non-GUI Spacemacs you can use (NOTE that in non-GUI Spacemacs, the remapping of ESC to C-g does not work in the Spacemacs 'home screens', but I guess it does work in most other buffers. For example try pressing
SPC followed by
ESC in the home screen):
(define-key key-translation-map (kbd "<escape>") (kbd "C-g"))
(define-key key-translation-map (kbd "C-g") (kbd "<escape>"))
There is a difference between (kbd "ESC") and (kbd "<escape>"), as 'very' briefly explained in this answer.
The second line of what you tried works in non-GUI Spacemacs. The first line does not, as it is not possible to use "ESC" with a control key.
Finally, what you tried should work in GUI Spacemacs if you just replace the