You can’t currently apply for a UK visa in Iran, but you can apply elsewhere if you’re an Iranian national.
Where you apply depends on the type of visa you want.
You’re an Iranian national applying for a visitor visa
You can apply for a visit visa at any visa application centre worldwide if you’re an Iranian national.
You’re an Iranian national applying for any visa
You can apply as an Iranian national in any visa category at visa application centres in:
You must apply online and book an appointment at a visa application centre. If you apply in Turkey you must pay for your application online.