If by diesel headcodes you mean the four character display on the front of the locomotive (electric as well) , there is no really simple guide, and the information changed year by year and from region to region.
The numbers are published in Working Timetables. and other operating documents and are meant to be unique to each train in a given area (but see below) . However where trains are very frequent numbers may be re-used on the same day, but this is exceptional.
Taking each character in turn
First position, - numerals 1 ro 9 and 0 - indicates class of train. e. g.
1 - express passenger
2 - stopping passenger
3 - various, parcels, goods etc. travelling at higher speed
4 - Express feight train (later used for Freightliners)
5 - empty passenger / parcels train (was freight train in past and empty coaching stock was 3 instead)
6 , 7 , 8 9, various goods trains, depending on speed and braking power
0 - light engine
This has changed a great deal over the years , at one time Class 9 was a unfitted mineral train with a maximum speed of 25 mph but nowadays it is a Ultra High Speed train capable of running in excess of 125 mph!
Second character - alphabetic letter - destination area or region
Trains travelling betrween different Regions
E - Eastern Region
M - London Midland Region
N - North Eastern Region
O - Southern Region
S - Scottish Region
V - Western Region
Within regions other letters used to indicate destination district or division , e.g. A - London.
These have also changed with time N disappeared when the Eastern and North Eastern regions merged, and then L was added when Anglia Region was formed.
Some special letters were used -
X - exceptional load, out of gauge load, Royal train,
Z - Special train not listed in yearly timetable.
Many 'on-track' machines carry X or Z codes especially if they cannot be relied upon to operate track circuits.
A breakdown train ran as 1Z99 going to attend to an accident and 2Z99 in the way back.
Final two numerals - Train identification number usually allocated consecutively starting with 01 at 00:01 and finishing at 23:59. Sometimes up trains are even numbers and down trains are odd numbers but sometimes the other way round. Also in early days the same code number was used for ALL trains making the same journey. See, I said it was complicated.
These numbers are still used in signalboxes to tell the signalmen which train is which, even though they don't appear on the train anymore.