Depends on the game. Some games on Game Pass are compiled as UWP (Universal Windows Platform) apps instead of as ‘normal’ Windows programs. The latter work perfectly fine, Game Pass or not, but UWP apps run in a sandbox that shields them from the OS and thus they can’t be hooked. Most games on Game Pass are normal Windows applications though.
TLDR: Game Pass or not doesn’t matter per se, normal Windows program vs. UWP does.