Simon and the Moon Rocket written and illlustrated by Edward McLachlan, published 1972.
Simon draws pictures on his chalkboard, then goes to the Land of the Chalk Drawings where his pictures have come to life.
There were a series of these books, but this is the only one I've seen. In this book Simon draws a moon rocket and goes on an adventure. He ends up on a planet where he's taken prisoner by some numbers he'd forgotten on his chalk board. To escape, he does some maths and turns all the numbers into zeroes.
Then goes home on the train.