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.
![image](https://archives.bulbagarden.net/media/upload/3/3e/Technical_Machine_PO.png)
In the next episode, File 2: Cubone, Red retrieves the TM28 (Dig) from a Team Rocket Grunt who'd stolen it.
![image](https://archives.bulbagarden.net/media/upload/c/ca/TM28_PO.png)
In the same episode, Red receives HM01 (Cut) after helping the captain of the S.S. Anne recover from seasickness.
![image](https://archives.bulbagarden.net/media/upload/e/e7/Hidden_Machine_PO.png)
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