Did Jesus, Mary, and Joseph go to Egypt or Nazareth?

Both.  As stated in Matthew 2, they went to Egypt and then to Nazareth.