Terms and conditions of poker sites disallow the use of VPNs for the purpose of grinding while in a restricted country, but the sites have no issues with regular grinders taking advantage of the vital security benefit provided by another layer of encryption.
It's not currently known exactly how Pokerstars, and other poker sites, detect VPN usage. It's likely to be one of the three following methods, however: Their website logs and stores known VPN server IPs, and when a connection is made from one of these IP addresses, the site knows that it's VPN traffic.