FRANKFURT — Prosecutors in Munich searched BMW’s headquarters on Tuesday as part of their continuing investigation into an emissions-cheating scandal that has badly damaged other German carmakers.

BMW, which is known for its sporty luxury cars, had until recently been relatively unscathed by the matter, which has cost Volkswagen billions of dollars, prompted investigations of the luxury carmaker Daimler and depressed sales of profitable diesel models across Europe.

The raids on Tuesday, in which about 100 investigators targeted BMW offices in Munich and an engine factory in Austria, suggested that all of Germany’s top domestic automakers may have evaded emissions rules, although perhaps not to the same degree as Volkswagen.

If so, the risk to Germany’s car industry, and to the nation’s broader economy, would increase sharply. Motor vehicles are the country’s largest export product, and BMW, Daimler’s Mercedes-Benz division, and Volkswagen’s Audi and Porsche units dominate the global market for luxury cars, where brand image is a crucial ingredient.