In the USA, it is perfectly legal to jailbreak your device using Electra jailbreak but, should you need to return your iOS device to an Apple store for repair, Apple may void your warranty if the device is jailbroken.