This specific question was answered by "What Car".
There aren't any specific laws or regulations to stop drivers listening to music through earphones.
However, Rule 148 of the recently updated Highway Code states that drivers should, 'avoid distractions... such as loud music'.
Listening to any music while driving has the potential to mask important sounds, such as other cars' horns or emergency vehicles' sirens.
Using earphones, though, is even more risky, as the source of the music is much closer to your eardrums. Earphones also act like earplugs, blocking out other sounds.
- Whilst it may not be illegal in itself, you may well find that the police consider it enough to go for dangerous driving, or drivig without due care, or something similar, much as they have with people caught eating apples at the wheel.