Question: How were the Egyptian magicians able to duplicate the first two plagues?
Answer: The classical commentaries had no problem with the Egyptian magicians being able to duplicate the first two plagues, because they accepted the existence of demons and magic (see Rashi on Ex. 7:22). But they also point out (ibn Ezra, ibid.) that the magicians did only small-scale things (“changing” a small amount of water to “blood”; producing one or two frogs), and these things could have easily been done by slight of hand.
All the Best, Rabbi Azriel Schreiber