No, it's not illegal to gamble with a VPN. By using a VPN to access gambling sites, you are simply protecting your online traffic from being tracked and ensuring that your personal information is kept secure.
Yes, it is legal to use a VPN to play at PokerStars if online poker is allowed in your country. However, keep in mind that VPN usage doesn't make an illegal activity into a legal one. So, if you live in a region where gambling is extremely frowned upon, you might still get into trouble.