You would be right in thinking that everybody has the right to purchase a lottery ticket and benefit from the chance of winning the jackpot. In fact, in some countries, presidents, prime ministers, chancellors and celebrities can buy a lottery ticket, win millions, and quit their jobs (though it might take a bit more consideration for them than most winners).
But, there are some people out there who are actually not allowed to purchase tickets by law for a number of reasons.
In many jurisdictions, employees of lottery regulators are not allowed to buy tickets even if they have nothing to do with the lottery section of the regulatory body itself. For instance, if an inspector is charged with enforcing alcohol regulations only, they are not allowed to purchase any lottery tickets whatsoever.
Also, employees of lottery operators are banned from purchasing tickets even if the operator runs lottery and casino operations. So, slot attendants and slot technicians would be banned from buying tickets even though they have nothing to do with the lottery side of operations and are simply employees of the operator. The reason for this is that the apparent conflict of interest could rile up public opinion and stir negative thoughts about lottery conduct.
If an employee of a regulator or operator - even if they are not involved in any way with lottery operations - were to win a large prize in a lottery draw, there would likely be outcries of cheating, favoritism, rigging, and countless other types of similar conspiracies and accusations.
It is far easier to enact an all-encompassing ban on employees of regulators and operators, including all departments, not just the lottery section, to pre-emptively appease that perceived public perception of any type of lottery "shenanigans" or improprieties.
A small number of jurisdictions ban retailers from purchasing tickets at their own retail lottery terminal or terminals within a certain radius of their home terminal. An outright ban would cause retailers to dump terminals and would lose tens of millions in revenue. But, again, to appease public perception and to prevent any type of retailer fraud, employees can buy tickets outside of their restricted area and still win the jackpot without any accusations of cheating or manipulation.
Some jurisdictions do ban politicians from lottery purchases, just as some jurisdictions ban anyone who is incarcerated from buying a ticket. Some ban non-citizens from playing the lottery, others ban those who are suspected or convicted of any type of gaming crime.
Some bans only target certain groups or individuals, while other bans encompass a larger area of occupations, statuses, or lawfully identified persons. So, not everyone is able to buy a lottery ticket if they want. There are some who are excluded and will never have the chance to win the lottery jackpot, let alone a small prize.
Different regulators and operators have different reasons for banning some people from playing the lottery. Some reasons are rock solid, being based on good laws and common sense. Other bans seem questionable at the least and totally insane at the most. So, you can be thankful you're not in a prohibited group.
Go out, purchase your tickets however you see fit, and let your dreams hopefully become reality.