Yes, blocking your IP address is legal. It is a privacy-enhancing measure that individuals can take to protect their personal information and online activities.