Can cataracts be removed if a patient has advanced glaucoma?

Yes, assuming that quality of life (Q/L) is being affected by the cataract, and that surgery would be expected to improve Q/L. There are additional potential concerns regarding surgery in eyes with genuinely "advanced glaucoma" rather than "otherwise normal eyes," and these should be discussed with your surgeon.