In most countries, liberal countries the use of a VPN, including one that can alter your apparent location, is completely legal. That is not the case for more restrictive countries such as China, Russia, North Korea, and several more. Before traveling to any country, please check whether the use of a VPN there will get you into trouble.