Is jailbreaking a Iphone 4 all right or is it illegal?

In some areas of the world it is illegal. In some it is not. Right now in the U.S some areas have it banned and some don't. In Canada some provinces have it banned and some don't