It's one thing for a 20mm or 30mm AP, API, HE or Ball ammo round to penetrate flat armor as long as it hits at close to a 90 degree angle. Bombs however are round so the chances of getting a direct 90 degree hit are very slim and that would cause the round to ricochet away from the bomb.
Also as stated above the bombs do not become fully armed until after they are dropped and have fallen away from the plane.
BUT for the sake of argument, if a round did penetrate a bomb case it would not cause it to explode, it would mearly cause a very hot fire as the explosive filler burnt out. Once the bomb case has a hole in it there is not enough pressure built up inside the bomb case to cause an explosion, it would just sit there and burn. However the other bombs could cook off if the fire was hot enough and lasted long enough.
This principle is being used today to disarm IED's and land mines over in Iraq and elsewhere around the world. Here is a link to an artical about the Dragon anti-mine device.
Dragon anti-mine device Future Weapons also did a piece on this thing and it's pretty neat. I have a buddy that works in EOD for the Navy and he's messed with the thing. He's told me that they disarmed a live and armed 155mm artillery shell with it and it didn't explode. It just burns a small hole in the case and that causes the explosive filler to burn out the hole. According to Jim in about a minute you end up with a hollow shell case that can be picked up safetly and moved, once it cools down, to be properly disposed of...i.e. scrap metal at that point.
So back to the original point of this....no a 20 or 30mm shell would be very hard pressed to cause a bomb to explode. Too many variables to be overcome for it to happen.