If you have an ear and sinus infection is it okay to have a cavity filled?

Yes, it's safe, but be sure to tell the dentist anyway. They will want to know, especially if you are on medications.

Yes it is ok to fill your cavity. Unless your have an acute infection and your doctor told you to stay in bed, then you can postpone your appointment. But if you can function there is no problem in treating your cavity.