There are several situations in hockey when the person on whom a penalty is called, is not required to serve the penalty (sit in the penalty box) them selves. I'm covering the two main ones here, today.
The first and most noticeable of these is of course the goalie.
There is no time, that a goalie ever has to "serve his time" in the penalty box. In the case of a Misconduct penalty on a Goalie, another player who was on the ice at the time the Misconduct occurred. Must serve the penalty in the stead of the goalie. A goalie is however required to leave the ice, if he incurs a Game misconduct, just like any other player. If you want more details, there's a handy link, below.
Rule 28 - Goalkeeper's Penalties
The second is the "Bench Minor" penalty. Which I have placed below, because it's short, sweet and simple.
Rule 17 - Bench Minor Penalties
17.1 Bench Minor Penalty - A bench minor penalty involves the removal from the ice of one player of the team against which the penalty is assessed for a period of two (2) minutes. Any player except a goalkeeper of the team may be designated to serve the penalty by the Manager or Coach through the playing Captain and such player shall take his place on the penalty bench promptly and serve the penalty as if it was a minor penalty imposed upon him.
17.2 Short-handed – see 16.2.
17.3 Infractions – Refer to Reference Tables – Table 3 – Summary of Bench Minor Penalties for a list of infractions that can result in a bench minor penalty being assessed (see specific rule numbers for complete descriptions).
Here are some additional Links to other rules and tables if you find yourself curious about more details.
A List of penalties that are called on players/coaches not on the ice (these can be served by any player).
Table 1 - Rule 15 - Calling of Penalties, Summary of Penalties to Coaches and Non-playing Club Personnel
A list of penalties not necessarily called on a specific player.
Table 3 - Rule 17 - Bench Minor Penalties, Summary of Minor Penalties
This covers the occasions when a player may be "switched out" while serving a penalty. (This is what happens when the players look like their playing "musical penalty box" during the game.)
Rule 19 - Coincidental Penalties
Since I'm not a hockey "professional" (just a very obsessive fan) I'm not claiming that this post covers every situation where a player may be substituted to serve another players penalty. These are just the ones that stay foremost in my mind.