Is it possible to kill a passenger or the driver of a tank shooting through a window with a scout rifle? Or I can only attack the tank in the normal way?
Provided you are playing as the scout class, yes bullets can penetrate into the tank and kill the people inside.
Basically you can deal damage while any parts of their character body are visible. So if you are going for a clean shot just through the tank window, yes, it is quite possible to kill your opponent.