While there are no specific rules in MLB OBR about caps and hats, rule 3.03 (a) requires all players to wear the same kind of uniforms. This includes the same style of cap, as well.
3.03 (a) All players on a team shall wear uniforms identical in color, trim and style, [...]
Rule 3.03 (c) goes on to explicitly disallow any player not wearing the team uniform to participate in the game:
3.03 (c) No player whose uniform does not conform to that of his teammates shall be permitted to participate in a game.
Two questions arise from that:
Who is considered to be a player?
What is considered to be participating in game?
While the rules don't give a clear answer to any of those two questions, let's assume that David Price was neither considered to be a player in this instance* nor was he considered to be participating in the game. The question that comes up next would be:
- Why was he allowed to be in the dugout in that case?
From DEFINITIONS OF TERMS:
BENCH OR DUGOUT is the seating facilities reserved for players, substitutes and other team members in uniform when they are not actively engaged on the playing field.
In this instance he should be considered an other team member and this definition hints, that all team members should wear the same kind of uniform, as explicitly required for players in rule 3.03 (a).
This leads me to conclude, that David was - by the rulebook - not allowed to wear his custom-made hat. But then again, there is always rule 8.01 (c):
8.01 (c) Each umpire has authority to rule on any point not specifically covered in these rules.
* On September, 30, when the Blue Jays won their division, they played two games. David didn't appear on any of the two lineup cards (Game 1, Game 2), so he was not eligible to come into the game. In this case it is fair to assume, that he didn't count as a player.