Yes, masking your IP address is perfectly legal in most countries. However, what you do with a fake IP address might not be legal. Depending on the country you’re in, using a VPN to change your location so you can bypass government censorship could get you in trouble with the law.