My mom was hospitalized and during Muharram she has been discharged. Can I give nazar during Muharram with the attention to thank Allah as she has been discharged?

Yes you can and there is no problem in it