German tax authorities are investigating up to 40 companies that might have used loopholes in sales tax laws to cheat the government out of hundreds of millions of euros in revenues.