Dex connects wirelessly on Smart Tv's ,however works more effectively with Samsung Tv's released from 2019 onwards. As has already been explained phone and Tv need to be on the same network. In addition you cannot have the link to Windows turned on at the same time.
See some more information here https://insights.samsung.com/2021/08/20/the-beginners-guide-to-samsung-dex-8/
I do not work for Samsung or make Samsung Products but provide independent advice and valuable contributions.
My Device- S21 Ultra 5G ( SM-998B/DS ) CSC= BTU , 12GB/256GB
One Ui 5.0,Android 13 .