A mage cast dominate person on two gnolls, and both failed their saving throws. He does not share a language with them, but an ally coached him in Gnoll to tell the gnolls to follow another that ally's commands, the one who knows Gnoll. Would this work?
The only part that might be questionable is the caster being coached in Gnoll for this purpose—the game treats languages as a binary thing, you either know them or you don’t (and if you don’t, you can only learn them by spending the appropriate character resource, usually skill points in Speak Language). It’s not clear that, under the rules, someone can learn “just enough” of a language for issuing a dominate person command without expending any character resource.
That said, it really doesn’t seem all that hard. After all, even with no knowledge of the target’s language, dominate person can still issue “basic commands,” and “do whatever this guy tells you” is a pretty basic command. Probably not quite basic enough to do without the coaching, but with the coaching, yeah, I’d allow it.
Once communication is established, I don’t think there’s any room to argue that “do what this guy tells you” is beyond the limits of dominate person. After all, dominate person doesn’t really have limits on what you can order aside from suicidal orders or “actions against its nature.” Gnolls might not like taking orders, but I don’t think that’s so strong as to be “against its nature” (now, if they were Chaotic-subtype creatures like slaad or demons, I might be inclined to believe that even just following orders is against their nature). However, I would rule that as soon as an order from the Gnoll speaker is suicidal or “against its nature,” then they can either ignore it or get a new saving throw at +2—because they are resisting your command to follow the Gnoll-speaker’s orders.