No. There's nothing in neither the Gambling Act 2005 nor the Police Regulations 2003 specifically preventing police officers from buying lottery tickets (or gambling in general for that matter).
The principal requirement from the Police Regulations is at Schedule 1, para 1 which is to do it (like everything else in life) sensibly:
A member of a police force shall at all times abstain from any
activity which is likely to interfere with the impartial discharge of
his duties or which is likely to give rise to the impression amongst
members of the public that it may so interfere.
However, there may be local force policies in place (regarding lottery tickets) but I doubt it.