The ball doesn't come from nowhere. Before you fire, the ball is physically loaded in the throat of the cannon. Once fired, that ball goes away. There's no real way to give it infinite ammo, or even one extra shot without making drastic changes.
Actually, there is a mod called the Tank, which WhyBeAre did a great video on. It can shoot and reel back in the shell. After shooting it with N, you press N again to bring the bullet back to the tank's barrel. It's a fun little vehicle to play around with. http://www.beamng.com/threads/7217-CL-27-Tank
Not really, I can't imagine that it would be much more difficult than either (A) make an array of cannonballs, or (B) have the cannonball teleport back into the cannon when the player presses the fire button again. The former may or may not be difficult depending on how much code would need to be changed to accommodate the array, and the latter is literally just designating X, Y, and Z coordinates, just like when you reset your car. - - - Updated - - - I can add rockets with the power of the Saturn V rocket on to a van, and have it drive under Sun-like gravity all while there is a 250 m/s wind hitting me, and after my car is totally destroyed, I hit a button on my keyboard and do it all over again. So real...