Is it legal to use a VPN?
YES.
VPNs are legal in most territories and frequently used by individuals and companies around the world to protect their private information and online activity; including those in countries with highly restrictive governments. Even in those states that discourage VPNs, most governments tacitly endorse their use by officials, academics, or business leaders as a necessary measure to stay competitive in an interconnected world. It is not practical for any country to ban all VPNs.
With or without a VPN, you should be aware that any illegal online activity remains illegal, whether it is caught or not.