History of Art at Oxford or Cambridge then going to work at Goldman Sachs as an analyst pays more than either.
Your degree subject is not necessarily the only or even main determiner of your income after graduating. Of note, STEM and non-STEM graduates have been found to have equivalent salaries in the long term, and CS had such bad graduate prospects for so long the government commissioned two inquiries into the matter.
If you're only aiming to do those degrees for money I would not suggest doing either, as chances are you will not make as much money as you think you will. Not all CS grads work at FAANG after graduating (most don't), and dentistry is a long degree with further training after graduating, and you aren't going to be making oodles of money as a newly qualified dentist working in someone else's practice anyway. Comfortable middle class income perhaps, but you aren't going to be driving a Bentley by any stretch of the imagination (and in fact unless you start up your own practice after becoming experienced, which becomes very successful that's probably unlikely anyway).