It is not law, but you should as someone else said be in control of your dog. However, you do not know what may happen to frighten your dog, another dog may run out at him from behind a hedge and cause him to run into the road, or there may be a car backfire, or any number of things, so if you are anywhere near a road, keep it on a lead.
For those who use those evil pieces of equipment called flexileads, please keep them locked on the short length when near a road. I witnessed a dog being chased by another dog, and it ran in the road to the extent of its flexilead and got hit by a car and killed.