If you want the TheTVDB ID, then I strongly recommend using TheTVDB to match and name your files. If you use TheTVDB episode information then {plex.id} will give you {tvdb-12345} markers.
TMDB ID and TVDB ID are not fundamentally interchangeable, even though that is the case for 99.99% of shows. There are TMDB entries without corresponding TVDB ID. There are TMDB entries with multiple corresponding TVDB IDs. And vice versa.