PC Jeremy Fowler, 40, is accused of sexually assaulting the man who was also rugby-tackled at Merthyr Tydfil police station.
The alleged victim was thrown to the floor in a bear hug after being taunted over his choice of T-shirt.
PC Fowler, from Brecon, Powys, denies sexual assault and the trial continues.
Prosecutor Ian Wright said the victim - who cannot be named - felt "shame and degradation" during the assault witnessed by a room full of officers at the station.
The trainee had entered the station's parade room with his supervisor while in plain clothes and in a T-shirt with the slogan "Replay".
The jury was told another officer, PC Matthew Davies, known for his "rugby club-type banter", was said to have rushed at the trainee and tackled him to the floor in a "hug".
While pinned down, the trainee claimed his belt was unbuckled and he was assaulted by someone else.
Mr Wright said the trainee was "humiliated" and kept the assault a secret for more than a year before rumours reached a sergeant who confronted him about it.
PC Fowler is said to have told superiors he merely rubbed the trainee's hair and face while PC Davies held him to the floor as a "bit of fun."
A policeman carried out a sex assault on a trainee as a "prank" in front of other officers in their parade room, Swansea Crown Court has been told.