Can an egg or sperm be formed through mitosis?

No, the daughter cells will still be the diploid number rather than the haploid number.