That's a nice idea of your religious teacher--that in the hereafter ignorant people will be given a 2nd chance.
However, I'd like to see any biblical support for it.
I Corinthians 15:29; 1 Peter 3:18-19, 1 Peter 4:6. The Lord respects the free will of all His creations.