When closed behind doors (I've tested oak and birch) dogs won't teleport to you and instead just run into the wall on the inside. Also when in long open stretches (like plains or a strip mine) dogs appear to just try and run to you instead of teleporting. I was riding in a minecart when this happened. I've also noticed it's more common with coloured dog collars (anything other than red). They do teleport upwards, but not horizontally it seems. I don't know if anyone else has had this issue, but when having a dog with you it's quite a huge flaw.
Thank you for your report!
We're actually already tracking this issue in MC-157494, so I resolved and linked this ticket as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature in the future to see if the issue has already been reported.