In San Francisco, at least, the trucks' cargo areas are locked and reasonably well-secured when the vehicle is not attended, to reduce the opportunity for exactly this crime. I'm sure there are areas where sniping a few boxes from a truck as the driver is otherwise occupied is not so difficult, but that's not something one could expect to get away with repeatedly.