In the episode "Charmander; the Stray Pokémon", it is established that if the flame on Charmander's tail goes out, he will die. At the end of this episode, the entire cast (Charmander included) rides a train off a cliff and into the ocean. Following episodes feature Charmander fine with no mention as of how.
After everyone reunites on the Roller Coaster, they fly into the air and fall into the water. Among the several Pokemon that were out of the Pokeballs was Charmander. In previous episodes, they've made it perfectly clear that if Charmanders tail got wet it would die. It isn't possible that Ash returned his Pokemon to their Pokeballs because he lost their Pokeballs at the beginning of the episode.