Key word advise - it’s not illegal to travel into or out of those areas.Not sure if you are joking or....
But yes, its a thing, taken from .gov website:
In addition, we are advising people not to travel into or out of an area if it has been categorised as a very high alert level area. This is part of wider measures to help manage the risk of transmission. You can continue to travel into or out of very high alert level areas if you need to for work, education, to access youth services or because of caring responsibilities.
If it was illegal they wouldn’t use the word ‘advise’.