Note : this answer assumes the classic "alpha/beta males" behavior of wolves. After a bit of researsh (thanks <PERSON> in another answer's comment section), it turns out that this is not how wolves behave in the wild. Assuming that the seed of this behavior is probably somewhere in the wolf/dog DNA and that the question aims for a story, using this trope as basis appears safe enough to me.
Like other answers already mentionned, the instinct is kind of already there. Let's see how it can be modeled to act like you want it to.
What makes a dog loyal? It has a strong pack instinct.
What makes a dog loyal to YOU? Because it sees you as the pack leader and it can't think of a reason of a way to overthrow you. It's fine as it is. Which I assume (not being a dog history expert), stems from the fact humans selected the most submissive kind of dog to when they started breeding them. This last part is based on my own personal (and limited) understanding of dog psychology. If this doesn't make sense, I'm afraid my answer just won't make sense.
So what about your dogs?
Picture a dog engineered so that at some point in it's lifespan, it wants to be the leader, and it will. With just a few other changes in the dog's psyche, it essentially becomes a wolf that really wants to be the alpha male. And you are in its path. This gives us an easy explanation for why the beast wants to betray you.
Here's the first effect of the genetic modification : at some point in it's lifespan, the beasts gets incredibly dominant until it's instinct dictates that it must be the alpha.
About betrayal : how can the dog do more than just beat you up and run away
Our hypothetical dog wants to kill you (or at least that you submit to it), but it will probably just wait for an opening, beat you up real good and take the lead. 376
At this point, we basically have an uncontrollable animal. This is probably not quite what you have in mind when you say betrayal, which is why we'll use the genetic engineering to change this.
So let's make the dog more subtle, it wants to stay close to you and cause trouble until something else kills you. This dog is patient and more methodical than your typical beast. The modifications that caused the surge in dominance also causes it to avoid confrontation with it's alpha until it's too late. This dog can actually understand playing a role and social manipulation.
Here's the second effect of the genetic modification : the beast gets unnatural intelligence (for a dog). It instinctively learned in it's submissive phase to play sneaky with it's peers. So much that to an extend it can even get close to understanding how humans thinks and work in society. This also causes it to avoid confronting the pack's alpha directly. It will play the part until you need his help and take the mantle of alpha. After all, why would it take a fair fight if it knows how to avoid it?
This behavior would probably not be good in the wild if it was widespread. But if we accept that genetic engineering is in there, it doesn't need to make sense from an evolutionary perspective. 376