In the case of 'standard' DNS (unencrypted port 53 traffic) - anyone can 'snoop' (ISP, internet routers, etc) and the resolver can retain that information.
In the case of DNS over TLS - it's the box the performs the decryption that can retain that information.
In this case, the ODNS Stub can retain that information.
The only question is who do you want to be able to view your queries. AKA who do you trust the most (or possibly, who do you trust the least).