No you cannot, Gmc guidance is clear that you should not prescribe for yourself or anyone you have a close relationship with, unless it is a real emergency.
As the UK has 24 hr medical cover.. There really is no situation where you need to prescribe for say your child.
Out of hours serviced are available via NHS 111.
However the Gmc would not refer a doctor to the medical practitioners tribunal service on a one of self prescribing issue... You'd get advice not to do it again.
Doctors who have a pattern of years of self prescribing or prescribing for relatives, or had been warned previously about it may get tougher sanctions.
To get referred to the tribunal who have the power to strike a doc from the register you'd have to have been doing something a lot worse, such as self prescribing and then selling opioids... Or prescribing in a patients name but getting the drugs yourself.. So being dishonest.