I have just had back surgery to take pressure off my nerves 3 days ago. Is it normal to have muscle pain in your leg while it heals?

Advice as a patient. Experienced this firsthand. Don't despair. It gets better. I'm symptom-free 7+ years later. Even with success, you may still get occasional symptoms. Best advice, maintain normal weight as best you can and stay active. When i got lazy and gained weight, my symptoms started flaring up until i lost it.
Yes. Decompressive spine surgery for a pinched nerve involves manipulation of the nerves intraoperatively which can cause short term nerve discomfort afterwards. Also, once the nerve is decompressed, it often burns as it "wakes up" for several days to weeks. An analog to this is when you wake up and your arm has fallen asleep, it burns for a while as it wakes up. This reactive nerve pain resolves.
Yes. It can be normal to have some residual pain in the lower extremity after back surgery. You should notice less intensity in the pain and hopefully less numbness, tingling, weakness, etc. If you notice worsening pain, and changes in bowel/bladder function, worsening numbness/tingling, or other issues, please contact your surgeon.