It's unclear whether eye rubbing is a cause or a symptom of keratoconus, or perhaps both.
Keratoconus is considered at least a partly a hereditary disease. So it may be that eye rubbing is a risk factor for keratoconus only among individuals who have genetic factors that may predispose them to developing the disease.
However, if you have a family history of keratoconus or if your eye doctor says you may have early signs of keratoconus, you should definitely avoid rubbing your eyes. Eye rubbing may increase your risk of developing keratoconus or make your keratoconus worse.
Even if you don't have any risk factors or signs of keratoconus, it's not a good idea to rub your eyes. Eye rubbing can increase your risk of pink eye and other eye infections by transferring bacteria and other pathogens from your hands to your eyes.