I am not a scientist, but am an electrical engineer with training in RF, EMF, Light theory, radiation theory, including x-rays, masers, lasers, etc.
X-rays are photons emitted at a certain wavelength (10 picometers to 10 nanometers). At this wavelength, the photons carry considerable energy, and can pass through many substances, such as soft, organic tissue, plastics, etc. They then strike a film, much like old camera film, which is sensitive tothe X-ray light spectrum, creating an image on that film, or in the case of airport security, the photons strike an array of light sensitive diodes, creating millions of pixels to create an image.
Substances such as metal, and bone block the transmission of the photons, creating recognizable shadows shadows, such as a chicken bone, or hand gun.
Since a chunk of meat, or herbs, and veggies won't be found with the x-rays, other detection devices that can sniff very small amounts of controlled substances, and explosives, are employed. Even dogs, are used for further detection.
The x-rays do not make a substance radioactive. The danger of x-rays, and the reason x-ray techs wear lead aprons, and stand behind leaded glass is because as the x-rays pass through the body, they can disrupt DNA and RNA in the cells, resulting in abnormal growth, or cancer.
Safe exposure limits have been established. The exposure that you get from a medical x-ray is minimal. An unprotected x-ray tech, who takes many x-rays every day, would quickly exceed safe exposure limits.
So, the answer to your question, "could food pass through airport or railway security check (e.g. x-ray or other devices?) be altered, affected, ionized or polluted etc?", is no. The x-rays won't pollute, spoil, or degrade the food. In fact, gamma rays, another even more powerful electro-magnetic photon wavelength, is used o sterilize foods, and kill insects, and other pests. gamma radiation of meat that is sealed in a air, ant water tight container will make raw meat shelf stable. It isn't often used as gamma emitters are pricy, and people just don't understand that the end result is not radioactive.
Seeeeya; Chief Longwind of the North