Can both heterotrophic and autotrophic organism survive in anaerobic conditions? If an autotrophic organism does not produce carbon dioxide but requires oxygen, it should not be present in anaerobic conditions, instead the heterotrophic organism can develop. Is this correct?
Autotrophs: Organisms that can synthesize organic carbon from inorganic carbon (carbon fixation). Nitrogen fixation is not considered an essential condition to qualify as autotrophs. True autotrophs can fix both carbon and nitrogen (Some algae. This true autotrophs is not an actual terminology).
Aerobes are organism that require oxygen for metabolism; it is not really dependent on whether the organism is autotrophic or heterotrophic. Anaerobes do not use oxygen for metabolism. Some anaerobes are aerotolerant i.e. they can tolerate oxygen (oxygen is highly reactive and can damage tissues) while others are not.
You can have a look at this post for some basics on aerobic and anaerobic respiration.
Some organisms are called microaerophilic i.e. they need oxygen but not in high concentrations.
It is not necessary that all heterotrophs are aerobic. Many are anaerobes (yeast etc.) Anaerobic Heterotrophs
These anaerobes live on glycolysis and fermentation (as far as I know). These two processes don't require Oxygen for release of energy.
Alcohol Fermentation takes place in yeast (just an example) and Lactic Acid Fermentation in Muscle Cells.
The autotrophs will take care of themselves as photosynthesis require no Oxygen. If place in correct conditions (light and water are available), then they will thrive.
So, the answer to your question would be that both can survive. It varies from species to species. If you select the correct one then, both would survive or only one of them.