As you may know, as soon as you flash any custom file with Odin to a samsung phone, it will trip a knox flag (which is build into an efuse chip and can only be resetted when you replace the motherboard of the smartphone) and this knox flag is used on some countries to check warranty. It's not the same behaviour in all countries/regions after all, but the main point for all living in the European Union is: tripping knox will not void your warranty! You can read more about it Please login to see this link.. Any other countries may have special rules to handle tripped phones and refuse warranty. Of course warranty is only given as long as it's a hardware damage not related to the custom rom/kernel/modification made by you!
The Please login to see this link. argues that it is legal to root or flash any device. According to the European Directive 1999/44/CE, replacing the original operating system with another does not void the statutory warranty that covers the hardware of the device for two years unless the seller can prove that the modification caused the defect.