Does glycolysis occur in both aerobic and anaerobic respiration?
No, it doesn't. Glycolysis is a form of anaerobic respiration. It is such because it does not require oxygen.
Aerobic respiration relies on the products of glycolysis, however, glycolysis is not considered a part of it.
I get what you're trying to ask, but the definitions are a little bit tricky. Aerobic means that it uses oxygen and anaerobic means that it doesn't. At the end of glycolysis, which is a process that produces energy (therefore respiration) but doesn't need oxygen (anaerobic) pyruvate can converted into lactic acid or go on to aerobic respiration (a process that needs oxygen [therefore aerobic] to produce energy [therefore respiration])