Carol M.Dex crosses the placenta. That is why it is has an effect on the fetus, when it is taken by the mother. Hydrocortisone does not. I don’t know about prednisone.
In fact, I believe many women who take dex for other conditions---such as asthma, etc.-- are often switched to a different glucocorticoid, such as hydrocortisone, when they become pregnant---the reason being to prevent any side effects of the drug on the unborn child.