legislation.gov.uk (section 4 & 5) states that dipped beam and main beam headlights are required to have an approval mark (usually E mark) or a British Standard mark. For nearly every other application on your vehicle, an approval mark is also required.
The legislation is quite detailed and in-depth so we won’t go into it all here. But for example, stop lamp bulbs are required by law to operate between 15 and 36 watts. The full legislation that covers halogen and filament bulbs is ECE Regulation 37 and is 217 pages long!
This may feel like the legislation is a bit pedantic but it’s worth noting that these rules are in place for your safety and the safety of others on or near the roadside.
Headlight units are manufactured around a specific technology. Let’s say that the bulbs for your dipped beam are H7. The "H" stands for Halogen meaning the headlight unit has been purposely built for a halogen bulb. The number that follows the "H" indicates that only a H bulb with the same number can be installed.
The aftermarket LED bulbs that are available have only ever been designed to replace their halogen counter parts and without supporting legislation, they can’t achieve an E mark.