The man who ordered the stormtroopers there was raised on Tatooine. Aside from Lord Vader, who had a very personal familiarity with the Sand People, the simple fact is that the stormtroopers were a highly-trained, elite military unit attached to a very important mission. I'd be more surprised if they didn't do enough research to pull off that sort of deception. And as Tritium21 points out in his answer, some of the stormtroopers may have been from Tatooine originally; they were riding dewbacks and banthas, after all, which indicates that there was at least a small garrison on Tatooine.
As Ben Kenobi points out, the only mistakes the stormtroopers made were related to them being too good at killing to be the nomadic Tusken Raiders. They travelled abreast rather than single file, as travelling single file in the desert would be very poor practice for any sort of combat mission (aside from a stealth mission, which this wasn't), and their weapons fire was too accurate to be from an amateur. That sort of attention to detail is something only another trained soldier - as General Kenobi was - would be likely to notice; to the average Tatooinian, this would be evidence of a Sand People attack. Luke Skywalker, in fact, does mistake the attack as a Sand People raid. The same sort of elite troops that could fire that accurately and track down the Lars so quickly and expertly, would have little trouble in mounting a relatively simple false-flag operation.