Minecraft wiki entry for Wolf, associated text: If the wolf has been ordered to sit.[1]
Exception: The wolf is likely to teleport if it is injured while sitting (it no longer sits after teleporting). An example is if a wolf that is sitting is hit by another player, it teleports to their owner.
Exception: If the wolf is in a loaded chunk, and the player gets damaged by a mob, there's a chance for the wolf to stop sitting, causing them to teleport if the player is far away, then attacking the player's attacker and sitting down afterward.
If the wolf is chasing after a skeleton. This can lead to wolves standing and jumping in one place, such as over a cavern if a skeleton is near. The wolf teleports once the skeleton is killed.
If the wolf is in a minecart or a boat.
If the wolf has been attached to a fence post with a lead.
If the wolf is in an unloaded chunk.
If none of the blocks on the edge of a 5×1×5 region centered on the player are transparent blocks with a solid block below and another transparent block above.
If the player is in another dimension; a wolf remains in its current dimension until the player returns. However, wolves can be transported to another dimension by pushing them into the portal first.
If the owner is not directly touching the ground (e.g. using elytra, swimming, flying, in a boat).
If the wolf is in any body of water, it may not teleport to the owner.‌[Bedrock Edition only]