Say you have a cube with sides equal to $1$ desimeter, dm. The volume $V$ will be given by $$V = 1dm \cdot 1dm \cdot 1dm = (1dm)^3.$$
This equals to $1^3 \cdot d^3 \cdot m^3$.
How come all places write cubic desimeters as $1dm^3$ then, without raising $d$ in $3$ as well?
You should think of "dm" as one word describing the unit. Short for "decimeter". The unit of volume is then $\text{decimeter}^3$.
But you can in fact "cube the d" if you do it right. The metric prefix "d" really means "multiply by $1/10$" so $$ (1 \text{dm})^3 = 1^3 \times (1/10)^3 \times \text{m}^3 . $$