
Sibelius Eos Owm |

That is actually an interesting question... Officially I would say there's no clear answer, but there are two obvious paths a GM could take. At first I was inclined to treat the rock the same way you might a grappling creature or other environmental effect and say the creature simply teleports out from its grasp. On the other hand, given that the rock isn't so much trapping an affected creature as merely weighing them down (i.e. you're not even immobilized, or even knocked out of the air if you were above 20') then I feel like it might be an appropriate argument to say the encased victims are 'wearing'.
So in my mind it comes down to whether you (or your GM if it's not you) feel like a creature should be able to DD out of the rock or if the rock would go with it. Likewise relevant to the argument is whether you argue that DD must bring everything a caster is wearing and holding, as opposed to, say, allowing them to choose whether to exclude things on their person from the teleportation.
Personally I'm most tempted to say that it works. The creature isn't even considered 'Grabbed' by the rock so spellcasting isn't adversely affected in any way, it's just a matter of whether the rock goes with, and I feel like the verisimilitude argument in favour of being able to leave it behind is stronger than the argument in favour of the spell deciding for you what is and isn't part of your gear when it's inconvenient.
Also from a balance standpoint, it still wastes 2 of the creature's actions (vs. just one for the Escape check) and possibly a spell slot, if it can't cast DD at will.
-
As a secondary thing which struck me when reading the description for this spell... the rock can be broken by the creature taking damage, but nothing specifies that the damage must be physical, or even tangible. Technically a creature trapped in rock could take 50 mental damage and the rock would still be broken as written.
Just thought that was funny.

Claxon |

The spell does not immobilize you, it gives you a penalty to speed. It's more akin to the molten rock being stuck to portions of your body, allowing you to move but making it difficult as the rock is stiff.
You could d-door just fine, but the rock would stay on you until you Escape.
I agree with Cordell. The spell is attempting to simulate being partially encased in molten rock, which has cooled an attached to you. It slows you down, but I would treat it more like worn equipment/clothes which you can't easily remove than as something you can teleport away from.
You can teleport/dimension door, but it's coming with you.
Edit: Also Dimension Door says "Opening a door that bypasses normal space, you instantly transport yourself and any items you're wearing and holding from your current space to a clear space within range you can see."
Personally I consider the rock to be akin to being worn and the spell doesn't have any provision about choosing not to take items with you.
If a player really was insistent about it, I might let them DD without any of their gear or the rock, but I think being completely naked is going to be more of an issue than the penalties the spell applies.