If you got married in another country and your marriage is legally valid in the country where it was performed, it is recognised as a legal marriage in the UK too.
If you married abroad it’s wise to check that your marriage was officially registered in that country. In many countries you need to have civil registration in addition to a religious ceremony for a marriage to be legally recognised, sometimes marriages conducted in other countries aren’t recognised in the UK.