Well, as M5 and I both described, now a days, its more a result of "MAKING" the engine sound a certain way, rather than just let it happen. Back in the day, when the designs of engines were a bit of a black art, you would see all sorts of designs and styles of engines. All of which would have a different sound. Then, as certain cars became more "known" for a certain sound, the company would try to get the new cars to still make that sound.
As M5 stated, when Porsche switched from the air-cooled engine to the water-cooled engine in the 996, they did a heavy ammount of work to get the exhaust and intake sound distinct and still have that "Porsche" feel.
Same goes for Subaru. Like I said earlier, the reason the boxer engines in a WRX sounds so funky compared to other engines is the fact that the header tubes are un-equal length. The exhaust pulses from each side of the car get from the heads to the turbo, and then out the car at different times. But, on the Spec-C car, they actually use an equal-length header on it, thus making it sound like every other 4-cyl car out there. That design can work better in some circumstances because of the "scavenging" effect on the exhaust. But either way, the Spec-C STi sounds nothing like a normal Suby because of it.
And, also like what M5 said, and similar to the Suby sounds, the design of a V-shape engine's exhaust is very distinct. On early Vipers, with the side pipes, many of the aftermarket exhaust solutions were just high flow units that didn't have an X-pipe. They would just have 2 banks of 5-cyls running off the engine, and then out the side of the car. Thats all well and good when stock. But not once you put an aftermarket exhaust on that has much louder sound and higher flow. The cars would end up sounding like they had real high strung 5-cyl engines in them. Not that good. Same goes for just about every V engine out there. They will almost always use some form of X-pipe to balance out the exhaust pulses to get the car sounding correct.
But overall, the sound of cars these days is all science. Back in the day, it was just the byproduct of innovative or unusual design. But now, with the computer simulation and ease of engineering processes, they can make a car sound pretty much how ever they want.
Hilg