Though we've never seen any TMs or HMs in the main animated series that follows the journey of Ash or Liko and Roy, a few have appeared in the animated miniseries Pokémon Origins, which follows closely to the plot of Pokémon Red and Green.
In the first episode, File 1: Red, Red receives TM34 (Bide) as a reward from Brock for defeating him in his Gym.
In the next episode, File 2: Cubone, Red retrieves the TM28 (Dig) from a Team Rocket Grunt who'd stolen it.
In the same episode, Red receives HM01 (Cut) after helping the captain of the S.S. Anne recover from seasickness.
It might also be worth mentioning that in the special Pokémon Mystery Dungeon: Team Go-Getters Out of the Gate!, TMs are referenced in the Japanese version, where, as Bulbapedia puts it,
While talking with the Kecleon Brothers, Charmander of Team Go-Getters mentioned TMs among other things the Kecleon Shop was sold out on. This reference was not included in the dub.
Source - TM
Source - HM