You can appeal to a UK court when:
Your current visa is cancelled.
You are refused entry to the UK.
Your extension application is refused.
Your British citizenship is revoked.
You have been deported or asked to leave the country.