You will need to contact the local authority in the country where you want to get married or enter into a civil partnership to find out what you need to do.
Your marriage or civil partnership should be recognised in the UK if you adhere to the specific country’s processes/laws accordingly, so you will not need to register it in the UK.
More information can be found on the UK Government website.