does every player that played a match in PG or SG position get trained as well?
Yep. To get full training, they require 48 min a week.
And are there any penalties for training when playing a player in a "wrong" position and training that position?
There is no such thing as a wrong position. The player may be pretty bad in a certain position due to his skill set, but that's it. The "best position" is merely a suggestion.