MP Megatron is packaged in robot mode, but the Customs people are trained to identify certain objects and outlines on the x-ray scanner, so know what to look for with this toy in robot mode (if you watch those border security type TV shows, they are very skilled at processing those scanned images).
Ironically, the Gen1 Megatron is packaged in gun mode, and yet I don't hear many of them (if at all) being spotted by Customs... so there was specific training to recognise the robot mode of the MP Megatron, IF they scan it during their random scannings.
The Japanese version of Gen1 Megatron was packed with pellets, but I'm not sure if the firing mechanism was removed from the American version.
It didn't fire caps. And the pellets were no more powerful than missile launchers, so aren't classed as more dangerous.
(some definitions for firearms actually states the requirement of a "gas or gunpowder" pressure behind the projectile... which rules out a physical mechanism inside the gun to launch a projectile).