Yes, as long as you register as soon as possible. It's easy to register so there's usually no real reason to take a prolonged time to do so.
One would argue that you are not self-employed until you receive your first payment. And there can be good reasons for not registering before you start, such as you got a last minute job where there's no internet connection.
However, if you didn't register for an unusual amount of time, for no reason, they might issue penalties.
See PMA Business Services FAQ
It’s important to let HMRC know that you’re self-employed as soon as
possible – even if you already fill in a tax return each year. If you
don’t tell them as soon as you begin self employment you may also
incur penalties. You can let HMRC know about your new self-employment
by registering online for business taxes. You’ll be asked for
information about yourself and your business. HMRC will set up tax
records for you using the information you provide, for example: