No, not at all! Pentesting is a completely legal activity. It is nothing but ethical hacking done on systems with legal support. It is mostly carried out for security research purposes. There are exclusive Operating System and software designed for this use.