Ukraine has been a major food exporter for many years, and that appears to still be the case even after the Russian invasion. You can still find a lot of Ukraine's major food exports, such as sunflower oil, in European store shelves. But since an ongoing war obviously brings with it unimaginable horrors and mayhem I was wondering if this might affect the food safety of food produced there. Are there any reasons to be concerned about food that is grown and processed in a country where there is an ongoing invasion and war?
Explosives and shrapnel are going to be a problem for farmers for years after the war as they deal with an ‘iron harvest’ (plowing up mines and unexploded ordinance especially, but also whatever else was left in their fields). However, most factory food production uses metal detectors in case a screw from something shakes loose and falls in, so it’s unlikely to make it to a consumer.
Factories are also going to have to screen their input for shrapnel (if it hasn’t already been done by their supplier) to make sure it doesn’t cause problems in their processing like damaging equipment. Plastics might be able to get through metal detectors, but there are typically visual systems to look for rocks and such that should be able to identify them. I suspect that any reputable supplier or factory would want to dispose of any loads that had contamination rather than risk something getting through and damaging their company’s reputation.
Another concern is going to be what sort of other weapons get used, as chemical, biological, and radiological (nuclear) weapons may trigger safety concerns, similar to Ukraine previously after the Chernobyl incident and Japan is still going through after Fukushima. In those cases, there were initially blanket bans on imports from those countries until the importing countries could be certain that the affected country had ways to ensure that products didn’t come from the contaminated areas. Many countries have similar policies when dealing with seafood to ensure it doesn’t come from polluted / contaminated waters.
From the regulatory and industry perspectives, there are two areas of concern in regards to food safety (in respect to the global food supply chain) that I believe this topic touches upon:
Food Defense: CFR 121.126 which is defined as, "...for purposes of this part, the effort to protect food from intentional acts of adulteration where there is an intent to cause wide scale public health harm...".
Food Fraud: 21 USC 342: Adulterated food
The distinction between these two elements is that food defense contends with "ideologically motivated intentional adulteration that makes the food injurious to health", whereas food fraud contends with "economically motivated intentional adulteration that may or may not make the food injurious to health". If the distinction appears to be rather ambiguous, it would be because historically speaking, one precedes the other: food defense first made it's appearance during November of 2002 with the passage of the Homeland Security Act in response to the September 11th attacks. This is why Food Defense particularly has several clauses that focus on bioterrorism prevention, interception of suspicious packaging, and secure access to food facilities. And while the concept of food fraud (within the scope of the US regulatory arena) date all the way back to 1784, the current regulations and views to this specific regard is actually quite recent; to be exact, the Food Safety Modernization Act (FSMA) was signed into law by President Barack Obama on January 4, 2011, and only just saw the deadline for compliance during September of 2018.
In a recent panel hosted by the World Health Organization (WHO), the subject of the war involving Ukraine is touched upon by several experts. Another dimension of warfare that isn't as well publicized is cyberwarfare, which has made a significant impact on the global food industry.
So to answer the OP: are there concerns related to food produced in such countries? Yes, there are such concerns. But as an end-consumer, should one be worried? Unfortunately, without being directly involved with the food supply chain and its various industries, there's likely not much one can do no matter how much one worries about this topic; just know that those who are in charge of these industries are aware of the potential dangers, and that reasonable efforts are being made to mitigate the potential repercussions involved. A big part of this is due diligence from the food suppliers themselves, so you might say purchasing foods produced by facilities that are 3rd party audited for food safety certifications (e.g., GFSI-benchmarked standards, such as SQF, BRC, FSSC 22000, etc.) theoretically reduces the risk of experiencing such repercussions, but often it's near impossible to identify these relations without being an insider of the industry itself.