I know in Sims 2 the game would choose names from a pool to use for townies. I haven't seen evidence that it works differently in Sims 3. If you chose a last name for your family which was also in the pool, the longer you play, the more likely it is that your game will generate a townie with the same name. I also suspect the game might be capable of incorporating names you use for its own use. There have been a few instances where I'd never seen a particular name in my game until I used it, then it popped up. That's just a suspicion, though.