Yes, it is perfectly safe.
The United States FDA provides the following information.
Q8: Is it safe to eat food, drink beverages, use medicine, or apply cosmetics if any of these products have gone through a cabinet x-ray system?
A8: There are no known adverse effects from eating food, drinking beverages, using medicine, or applying cosmetics that have been irradiated by a cabinet x ray system used for security screening.
The radiation dose typically received by objects scanned by a cabinet x-ray system is 1 millirad or less. The average dose rate from background radiation is 360 millirad per year. The minimum dose used in food irradiation for food preservation or destruction of parasites or pathogens is 30,000 rad.
For more detailed information on radiation used for food inspection or food treatment, see Title 21 CFR 179, www.FoodSafety.gov, contact FDA’s Center for Food Safety and Nutrition, or contact the United States Department of Agriculture Food Safety Inspection Service.
The UK Food Standards Agency agrees with the FDA
Is it safe to eat food that has been through a X-ray scanner, for example at airports?
Yes, it is. X-ray scanners used at airports for baggage control operate at very much lower energy and give rise to radiation levels very much lower than radiation sources used in food irradiation facilities. The radiation doses used to process food can be as high as 10,000 gray, whilst X-ray scanners operate at less than 0.5 gray. It is very difficult, if not impossible, to detect changes to food once it has been through an X-ray scanner.
The Food Irradiation Regulations 2009 specifically excludes X-ray surveillance devices which impart a radiation dose of less than 0.5 gray and operate at less than a maximum energy of 10 MeV (for example the ones used in ports and airports, which would include those used for commercial cargo). If the devices operate above these levels, they fall within the scope of food irradiation legislation, but the FSA is not aware of any devices currently in use which do exceed these limits. In fact many of these X-ray machines (at airports for example) operate at such a low dose that they don't affect photographic film.
The Journal of the American Medical Association published an article(1) on the subject of x-ray machines for airport security that contains the following:
Will the x-ray examination of medicines inactivate them? No, nor will
these levels of radiation affect food.
The Health Physics Society addressed the issue in one of their "Ask the Experts" columns:
Answer to Question #6115 Submitted to "Ask the Experts"
Category: Security Screening
The following question was answered by an expert in the appropriate field:
If I place my breakfast, lunch, snacks, and water into the x-ray screening machine at work, is this safe when I will need to do this five times a week, times 52 weeks a year, for the next 25 years? What long-term effects could this have?
Thank you for your question. Sending food items through a screening machine, whether at the airport or in your workplace, will not do anything to the food and the food will not contain radioactivity after it passes through the x rays. There are no short-term or long-term effects on the food or for you.
Certified Medical Health Physicist
(1) Holder Lawrence E. X-ray Machines for Airport Security. JAMA. 1975;233(13):1393-1394.