duty on imports at the moment go to the EU for operating the customs union. The collecting authorities (HMRC) retains 10% of the receipts to cover operational costs. The local authority is also charged with defending patents and such likes on imported goods. There was a recent case of the EU taking HMRC to the ECJ on the ground that HMRC is too lax with Chinese importers, some of them importing fakes into the UK and use platforms such as ebay and amazon to sell fakes into the EU27.
From 1/1/2021, the UK will exit the EU's customs union, HMRC will retain all import duties paid by importers. That is why WTO brexit is tax-wise attractive as we import a lot more from the EU than export to the EU.
VAT is paid directly to HMRC. However, the UK is in the EU common VAT area. That allows crossborder trade without any form of checking except when the authorities suspect that a particular shipment breaks EU rules or a product of criminal activity. Every year, HMRC loses about £1 billion in VAT fraud, mostly by Chinese importers. They sell crossborder without charging VAT, so their goods appear to be 20% cheaper, gaining a competitive advantage on platforms such as ebay and amazon.
From 1/1/2021, the UK will exit also the common VAT area except possibly Northern Ireland. Such illegal crossborder sales will cease.