Right-handed neutrino production in dense and hot plasmas