The poppies usually used for culinary seed production, Papaver somniferum, are also known as opium poppy for the very good reason that opium is produced from these plants. It is not the seeds that produce the harmful drug, but the latex sap obtained by scoring the immature seed heads produced after flowering. A very large number of plants would be required to produce any significant amount of the drug, and some people claim that the varieties sold for culinary purposes are much lower in the drug-producing substances.
Opium poppy seeds are easy to obtain, and are apparently entirely legal to sell. The plants, on the other hand, are probably not legal in Canada or the United States, but nobody really seems to know. Among other companies, Richters sells the seeds for planting; they rationalize this by saying that the restricted substances obtained from poppies are illegal, but the plants themselves are not. This argument seems tenuous at best, but the fact remains that poppy seeds and even plants are readily available through mail-order and at nurseries.
So will you be arrested for planting opium poppies? The law has recently been enforced in Canada, but the man in question had over 1200 poppies, and was using them to produce drugs (for himself only). A small planting not used for drug production seems to be a gray area, and probably won't get you arrested.
The corn poppy, Papaver rhoeas, is listed by some sources as also having edible seeds. While the culinary value of these seeds is said to be inferior to that of Papaver somniferum, it may be worth a try if you are very concerned about legal issues. Most other "poppies" are not true poppies, and should not be eaten, so always check the latin name.