Pets use similar pathing methods that the various mobs in Norrath do. Which means that they will have a rough time keeping up with you in dungeons that have twisty hallways, and paths. If you make several turns before the pet makes one, then it sees you in front, and not the path that you took. You need to remember to take it slow in dungeons, and make sure your pet is with you at all times.
Also, if there is a pathing bug in a dungeon, your pet is sure to find it. Be sure that you know where any pathing bugs are and remember to avoid them if possible. Take Mistmoore for example. If you are standing near the front pond, and you attack a mob, it runs in a triangle type pattern before getting to you, thus, sometimes agroing other npcs. Don’t think that you can just hug the wall and expect your pet to do the same, because they won’t.