Yes. Dogs can follow you everywhere in Minecraft. But if they are commanded to sit, they will not follow you anymore.