To get to the cannons, you have to beat the level that is connected to the cannon differently. For example, if there is a cannon on World 4, and the path to it connects to level 4-3, it means that there are two possible ways to beat 4-3 to access it. Hope it helps