First let's get some biases out of the way. Many people would think that you are male (at least I assume you are), therefore you are the Alpha of the pack, therefore the dog doesn't attack you. Your wife is female, therefore the dog thinks of her as inferior and attacks her.
This logic is completely flawed and untrue. It's a bunch of lies a bunch of sexist 'scientists' sold as facts almost a hundred years ago and that has been disproven since. Dogs aren't sexists. Anecdotal evidence: My own dog accepts female leadership without complaint but becomes aggressive if a male family member crosses certain lines.
What really happens is hard to tell without seeing both your behaviors. What comes to my mind are a few possibilities:
- Your dog was socialized well with men, but not with women. It might be that a woman caused him pain or discomfort as a puppy and due to lack of exposure he didn't learn that this was an exception and is now wary of all women. (This is exactly what happened to my dog, but with men. He lives happily with a man in the household, but as soon as said man does something 'weird' he becomes wary and aggressive.)
- Your wife's body language during your tickling is more aggressive from the perspective of a dog. I assume you're laughing and talking to each other while doing it. Laughing exposes your teeth in a way that may seem aggressive for a dog. The talking may be in a pitch or a way the dog perceives as aggressive. Maybe even some of her gestures are unknowingly aggressive, like lowering her head and 'stalking' you in a way a wolf / wild dog stalks its prey.
- Your wife's body language and manner is more submissive in general. Your dog does perceive you as the pack leader, but not simply because you're male, but because your wife's behavior in general indicates that she submits to your leadership. That can include her tone of voice and gestures and behaviors she isn't even aware of. Now if you 'attack' her it's tolerable for your dog, but if she 'attacks' you, that means disrespect, fighting and possibly chaos in the social structure of the pack. Your dog is trying to end the fight and restore harmony. Unfortunately he shouldn't be allowed to do so because it can lead to problematic behaviors in the future.
- Your own reactions to her tickling are more over the top and the dog thinks your wife is doing you harm.
- Your dog does indeed have a closer relationship to you than to your wife.
You see, there are many possible reasons and each of them may need a different approach to solve the problem. I suggest you look for a dog trainer who comes to your home, analyzes the problematic situations and gives you advice on how to change your behavior. This gives you a better understanding of the thoughts of your dog and often drastically improves the comfort and well-being of both dogs and owners.
The only solution I can offer is this:
- Train your dog to go in his crate (if he has one) or his bed / pillow / whatever on command. Your wife must train this until the dog reliably goes there on command.
- When you play fight or tickle each other and the dog starts nipping, your wife should send him into the crate / bed. You should not interfere with her authority by giving the same command. Once the dog is there, resume your play fight in a tones down version for just a second and then reward the dog with a treat for staying in the crate / bed.