But I'm allowed to work even before getting the NI number. How, I have no idea.
It's your visa that allows you to work, not the National Insurance number.
The NI number is just used to work out how much tax and NI contributions you have to pay each month.
If you start working before you have the NI number, you'll just be taxed at the 'emergency tax' rate... and then when you get the NI number through, you can get the tax rate adjusted. If you have paid too much tax before getting the NI number, you'll get a refund

.
After I graduated uni, I worked in retail for a year. Despite having had an NI number since I was 16 (which is when Brits get one), I was put on the wrong tax code... and didn't realise it until I'd been there almost a year. I contacted my tax office to get it corrected... and they sent me a cheque for £1,500 for overpayment in the previous tax year, then for the next 6 months or so, I got a credit on my tax each month until I had received all the money back

.