Yes, it is possible. Suggest you go immediately to the passport & immigration office and get the extension done. Don't waste a single day. Don't disclose you have resigned. They can then leave along with you. I think what your company HR people are saying is correct.