At least the EU attempts to have a system in place. If you read the regulations about the fees, it's completely filled with explanations of how they enforce it to be paid at time of purchase, and not at time of import with a bunch of processing fees slapped on top.
UK is planning to have customs duties (%) collected precisely at time of purchase for everything. EU is too in 2028, but unlike UK has these fees in the meantime.