First of all, it appears that at least one of the Saudis who went to Turkey was traveling on a diplomatic passport. To enter a country as a diplomat, the host country is entitled to prior approval of that diplomat arriving – think of it like a visa. (If you were a diplomatic passport holder, you can’t just show up in any random foreign country and force your way in because you hold a black passport.)
Diplomatic officials are entitled under the Vienna Convention to transport material free from interference from the host nation. This is generally to protect communications and papers, but the contents of the diplomatic bag can include physical items intended for official use. For example, if the U.S. Embassy in Beijing needs computers for the staff, they would be taken in a diplomatic bag (well, crate) so that the Chinese intelligence services operating under the guise of customs inspectors have no means to install bugs or malware or whatever. If I recall correctly, construction materials for the U.S. Embassy in Moscow were taken in under diplomatic seal, to include things like drywall and steel and so on.
There are procedures in every country that govern the paperwork needed to transport diplomatic pouches, but yeah, host nations are prohibited from inspecting such packages as long as rather minimal procedures are followed.