Only wild Pokemon found in Raid Dens are able to D-max or G-max. Otherwise, no, wild Pokemon cannot D-max.
There are a couple of story encounters where a small number of wild Pokemon are able to D-max, but that is explained in the post-game Swordward/Shieldbert story.