In football, if team A wins and a player from team A mocks team B for losing (call them a idiot team, non-fair-play attitude, etc.) can the referee give a red card to that player after the match ends?
Referees can take action as long as they are still on the pitch after the game has ended. This is covered in Law 5: The Referee
[The referee] has the authority to take disciplinary action from entering the field of play for the pre-match inspection until leaving the field of play after the match ends (including kicks from the penalty mark). If, before entering the field of play at the start of the match, a player commits a sending-off offence, the referee has the authority to prevent the player taking part in the match (see Law 3.6); the referee will report any other misconduct.