It works the best with DNS-over-TLS and I've done it on an Android TV and Shield TV Pro.
You need to enable developer options first (Android settings on TV > About > scroll down to Build and click on that several times). A new "developer options" section will show, and here you need to enable USB debugging. After that run some commands over ADB from a PC/Mac. To get the ADB executable see here: https://www.xda-developers.com/install-adb-windows-macos-linux/.
Basically after you enable debugging, you connect using the IP of the TV and allow the connection on the TV:
adb connect 192.168.x.x
to disable private dns
adb shell settings put global private_dns_mode off
to enable private dns with hostname
adb shell settings put global private_dns_mode hostname
adb shell settings put global private_dns_specifier Your--Device-bxxxxx.dns.nextdns.io
This will override and DNS from the network settings. After setting this up you can turn of developer options.
ref: https://www.reddit.com/r/nextdns/comments/18dd4ok/setup_on_android_tv/