Hi Aspirant! As you have not mentioned any class for which you are asking query.
So I am considering that you are either asking for 11th or 12th class case. In both cases, yes you are allowed to write the improvement as well as compartment exam if you score less or get failed respectively. You can regoster for the same wither by asking to the school management or by applying directly to the CBSE official website.
Thankyou!
Regular exam updates, QnA, Predictors, College Applications & E-books now on your Mobile