A writ of mandamus, essentially a court's command, can be sought in UK tax matters to compel a public authority to perform a specific legal duty. This typically applies when a public servant is bound to take a mandatory action, like refunding illegally collected taxes, and fails to do so. However, it's crucial to note that this remedy is generally only available after exhausting all other available legal avenues and is not suitable for cases involving complex factual disputes.