Can we remap the keys when using an external keyboard?
Use GBoard (the Google Keyboard), it should be very easy.  Install this then when you are connected with the external keyboard, change the keyboard to Brazilian Portuguese and you shouldn't have any issues.