Can person with testicle hernia still be able to ejaculate semen in his sleep?

Yes. Ejaculation, passage of sperm from testicle & semen production are unaffected by a hernia. Would be good to have hernia, if still present, repaired if U can.