You can choose to pay voluntary class 2 national insurance (NI) contributions if you live and work abroad. The only requirement is that you worked in the UK immediately before leaving, and that you previously lived in the UK for at least three years in a row or paid at least three years of NI contributions. If you've retired abroad, you'll need to pay class 3 NI.
This may be useful if you want to have access to some benefits – including the state pension – if you return to the UK. In fact, you can continue to receive your state pension even if you don't return to the UK, as long as you have at least 10 qualifying years of NI.