Legality of any videos or television programs you watch through IPTV depends on How you watch it. You can’t tell all IPTV’s are illegal. Some do it officially and through these official channels, whatever you watch is completely legal. But there are few IPTV service providers who tune recorded TV programs which are illegal.
If you are paying for the IPTV services, then whatever you watch through the specific service provider is considered legal. Unless you try to download the copyrighted material. If you are downloading copyrighted material and sharing it to someone, then it is illegal.
There are providers who give IPTV services for free. Before subscribing to those providers, always recheck whether they are streaming legal contents. If they are streaming recorded copyrighted contents, then you might have to face legal issues as well.
Some countries don’t consider it as illegal to watch IPTV. But if you are recording it or downloading it, then it is an illegal activity. It is always better to stream it online through a VPN. As your identity will not be revealed if you are using a VPN