The website Researching the Lives and Records of WW2 Soldiers, by Robert Clark, includes a table of number blocks assigned to each corps or regiment of the WW2 British Army. This may be helpful if you have a number but don’t know the unit.
The numbers were allocated on joining, Beware, the soldier may have only been with that corps or regiment for a short time before transfer. The number stayed with them.
The Royal Artillery was assigned over one million numbers, just 599 to the Band of the Royal Military College.
Sub-blocks may have been allocated to various enlistment centres.
Find the table at http://www.researchingww2.co.uk/army-numbers-british-army-ww2/.
WW2 Canadian Regimental Numbers had blocks with a letter prefix referring to the military district. For instance, the prefix B, for Trooper Anthony Dashney, Service Number: B/83334, who served with the Royal Canadian Armoured Corps, indicates MD2 (Central Ontario including Toronto and northward). See https://www.canadiansoldiers.com/procedures/regimentalnumber.htm/.
Stay tuned for more detail on allocation of sub-blocks of numbers for the WW2 Canadian Army.