The current valuation rules stem from WTO Valuation Agreement and are enshrined in the EU legislation. This legislation is directly applicable as law in the UK.
The EU (and the UK as a Member State) adopted and implemented the current rules on 1 July 1980.
Briefly the Agreement requires that the customs value of imported goods is determined using one of the six methods of valuation. These methods are detailed in GACV02000 onwards.