The National Lottery is governed by specific legislation, which is enforced by the lottery operator in the UK, Camelot. It is also occasionally enforced by local trading standards authorities.
In practice, this legislation is enforced by Camelot under Operation Child. A test purchase failure will usually result in a warning letter and a further test purchase attempt. A second failure may result in the revocation of the lottery terminal in the retailer. That is often penalty in itself, so there have been relatively few prosecutions before the court.
It is also worth noting that Camelot have acted to remove lottery terminals from retailers that have been convicted of selling other age restricted products to children. This can, for instance, be an indirect consequence of the suspension of an alcohol licence by a local authority for under age sales.