I'm told they (the Navy) prefers you do it before dental school ends (you can also possibly do it while in dental school during a break if you have one long enough that coincides with training dates), because it allows you to go directly to a station out of school.
I've also heard that doing it after dental school is good because everything "Navy" and "officer" will still be very fresh as you go into service. On the flip side, doing it before school or before it ends allows you to go into a residency right out of school should you get selected (this is just what I've heard).
Personally I'm going to try to do it during dental school (as I'm interested in doing a GPR or residency program), doing it before isn't an option for me.