Yes, there was television in the 1930s. In 1938, New York City was the home of NBC’s W2XBS. It had also been the home of the Terrytoons studio a few years earlier. So it’s not a surprise Terry and his story department tossed in a TV gag in the short “Bugs Beetle and His Orchestra” released that year.
The evil spider is awoken by the NBC chimes and tunes in his set.
He spots a luscious female bug. He kisses where she is on his set.
Her boy-friend bug violates the confines of the TV set and slugs him.
The angry beetle cracks his TV screen in response.
Whether this is the first TV gag in a cartoon, I don’t know, but it must be one of the earliest.
Fittingly, when W2XBS began somewhat regular programming in 1939, it featured Terrytoons.