This was an animated series broadcast in our Doordarshan channel about a couple of decades ago.
It was about a boy and dog who jumps under the carpet, after his mother switches off the light, and they go through a rainbow tunnel and emerge out from a tree trunk into a wonderland. It had a catchy background tune. After they finish their adventures they get back uncaught to the bed to sleep.
I'd like to know the title of this series or any links that might help.