You do need TSA and Visa for most (not all) FAA flight training but not for the written exam. Whether you need it for ground school is a good question but IMHO it would be stretching things massively because the training could apply to flying in any airspace and in any aircraft registration.
There is also an 18hr/week figure in the regs, for the Visa I vaguely recall, below which it doesn't apply. The TSA requirement is fairly clear but the Visa one varies according to which person in which Embassy you speak to. Most flight training and most ground school would fall under the 18hr/week figure.
That incidentally is a way to avoid TSA issues for flight training in Europe: all ICAO-instructor training is allowable for FAA requirements and particularly if done in a non-N-reg plane nobody can say whether it was towards an FAA requirement, or just any old recurrent training flight.