I'd say rock tomb and rock slide probably are akin to surf or dive being possible on land; mainly taking the environment into account would be hindering in so many cases to several moves (and certain pokémon in general, such as the fish-like ones) that it's probably just best to suspend disbelief for the sake of the gameplay. Then again, the developers appear to have been experimenting with making environment matter recently what with terrains and sky battles being introduced lately. I doubt the logical extreme would be taken though, seeing as, again, that would probably mean making pokémon like kyogre near useless for example, and probably even greatly decreasing the convenience of surf in battle (which is one of the rare moves that's just as useful inside battle as it is outside).
You did remind me of another odd thing about rock moves, namely onix being able to use rock throw. Even as a kid I wondered how a snake could throw anything. Flinging something with its mouth wouldn't seem that efficient, though it's not like rock throw is that damaging a move in any case.
As for ditto, that's like asking why a pokémon gains mass once you release it from a poké ball (i. e. why you can walk with a ball containing a snorlax in your belt without throwing your back out) or why it gains mass when it evolves. Pretty much, it's a pretty well established paradigm in the Pokémon universe that conservation of matter is played very loosely, so that's more something nonsensical by real world standards than Pokémon standards.