Option 1: when you are a D4 and ready to graduate, upload your pic with a white coat on Tinder/Bumble/Okcupid/etc/etc and you will find true love with no bad intention, make sure he/she is a US citizen, and get married. and you will get a green card within 6-9 months. With a green card, you are basically a US citizen without the right to vote, hence you can open a clinic, buy houses, and do whatever you want.
P.S: before anyone jumps on me for recommending sham marriage, I am only suggesting finding true love.
Option 2: I believe you get a 1 year OPT and will get a 2-year extension on OPT for STEM major (dentistry is included I guess) unless the president terminates it. You will work during this OPT and apply for H1B visa or EB3 (talented worker). This track requires lawyer and I believe a company has to agree to sponsor you (hello big DSO working in middle of nowhere with a tied 3 year contract). This track also requires you maintain continuous employment during your OPT and/or H1B/EB3. Reading the law and the risk/reward of this option 2 makes option 1 looks way better.
dentistry is oversaturated and the sky is falling but so far no dentists is on food stamps and bread line yet so finding true love being a almost dentist (D4) is very easy in my opinion. Heck, you probably will end up dating and marrying your classmate but I don't recommend this route.