the rules state that if in the umpire's judgement the pitcher intentionally threw at the batter, then he may expel the pitcher, the manager, or both, or may warn the pitcher and the manager of both teams that another such pitch will result in expulsion of the pitcher and manager. He may also warn both teams at any time if warranted in his judgement. The rule is 6.02(c)(6) to 6.02(c)(9)
There's no provision to warn just one team, I guess, because that would essentially give the other team a free pass to retaliate.
The rule also says that if anyone leaves the dugout to argue a warning, they should be warned to stop, and if they don't stop, they are subject to ejection.
https://content.mlb.com/documents/2/2/4/305750224/2019_Official_Baseball_Rules_FINAL_.pdfthere are also more specific rules for intentionally throwing at a player's head, including immediate ejection and automatic 10 game suspension. The umpire may warn the pitcher if he thinks it was unintentional.