If one player goes all in then a second player raises and goes all in as well, then a third player exposes their hole cards to another player, Can the third player still go all in or are their cards dead because they exposed them?
Depends where you play but in the end you need to ask the rules before you play a tournament or after something like that happens. Every casino/home game has its own rules.
But most likely if no one plays after the third player and he shows his cards to someone it won't matter if he goes allin or folds. Most places would accept either decision because it doesn't affect the current hand. But normally if he shows the hand to one player he normally has to show it also to others in case he wants to folds.
If someone plays after him than again it depends on who he showed it to.
If he showed to a player who folded most places would still accept either decision (allin or fold). Normally the player who saw the cards is not allowed to talk after he saw them.
If he showed it to a player that is still in game he would have to show the hand to all players and most likely would have to take a decision with his cards face up or fold depending on the casino/home game rules. (casinos tend to decide to muck the hand and not allow the player to go allin.)
Bottom line: its the rules of the house. Know the house rules. If it's a tournament the tournament manager or another judge can make the decision if there is a dispute, or the dealer will be able to call someone over. If you're at a home game and this isn't addressed you should probably try to convince the host to do a little research and make an official set of house rules for the dealers to follow. Keep in mind that tournament rules are often different than cash rules.
I agree with the other answers indicating that house rules are probably the most important factor here. The TDA tournament rules touch on this subject though (italics added by me):
59: No Disclosure
Players are obligated to protect other players in the tournament at all times. Therefore players, whether in the hand or not, may not:
Disclose contents of live or folded hands,
Advise or criticize play at any time,
Read a hand that hasn't been tabled.
The one-player-to-a-hand rule will be enforced. Among other things, this rule prohibits showing a hand to or discussing strategy with another player, spectator, or advisor.
60: Exposing Cards and Proper Folding
A player who exposes his cards with action pending may incur a penalty, but will not have a dead hand. The penalty will begin at the end of the hand. When folding, cards should be pushed forward low to the table, not deliberately exposed or tossed high (“helicoptered”). See also Rule 57.
What you've described sounds like something that might fall into rule 60 here, if you're in a tournament context, which would result in some admonition from the tournament director but which would not necessarily result in an immediate dead hand.