It's not illegal to use a VPN, unless you live in one of the countries where using a VPN is forbidden.
Individual service providers may not want you to use a VPN with their services, because it disguises your location. They can ban you from their service if they detect that you are using a VPN.