TFS 2018 is out of mainstream support so it might work, it might not. Personally I don't see any reason why it wouldn't as it is really just a web site and a couple of services. I wouldn't expect any issues. I don't remember the timeframe when the last update to 2018 was released but Server 2019 was most likely available then so it should just work.
But, of course, if it doesn't then there is no support. Having said that, Server 2019 mainstream support ended Jan of this year. So I'm not really sure why you're trying to install a no longer supported product on a no longer supported OS. If this is a brand new setup then it seems that you should be using something that is still within mainstream support. Extended support only provides critcal bug fixes and if anything goes wrong on the server/product then you're not going to get any MS support. Seems like a risky move to me.