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.