You can choose to use that server or not
If a network intercepts your DNS traffic, you can encrypt it yourself. If you don't trust the network you should be encrypting everything anyway
If you're not using DoH, a malicious network will just redirect your requests to legitimate DNS servers to instead go to its own.