It would be interesting to know the specifics of how various sports handle officials getting in the way of play, whether getting run into by players or the object of play hitting them. I know some of them from memory, but not necessarily all the exact details except for hockey.
Hockey: part of the game. Pucks hitting them are in play no matter what happens, except that if a puck deflects off an official and
directly into the net, it doesn't count. The boards count for making it no longer "directly" in case the very odd and unlikely circumstance were to ever happen that a puck hits an official, then bounces off the boards and into the net.
Baseball/softball: somewhat part of the game. They're all in foul territory except for the second base umpire, but if they accidentally impede a base runner, too bad. A thrown ball bouncing off an umpire, I think, is simply unfortunate but play continues. A batted fair ball is a dead ball, and I believe in that case that the crew chief can award bases or outs based on their judgment of how the play would have unfolded had it not hit them. Not sure what happens if a batted foul ball hits an umpire; that would be an extremely rare occurrence, but I'm sure there's some rule that covers it.
Football: part of the game, more or less at least I think. Players run into officials somewhat uncommonly since most of them are not in bounds during play. Not really sure what happens if the ball hits them. My guess would be that if a live ball hits them that play continues, unless it's a forward pass, in which case the play would be blown dead and the pass ruled incomplete.
Basketball: completely in play as far as I know, though they're almost always out of bounds in the first place. I have, however, seen an errant ball bounce off an official while he was in bounds, play continued, and the team that got the ball off him immediately made a basket. The announcers joked that it was the referee's first NBA assist. A ball bouncing off an official and into the basket is next to impossible, but I have no clue what the ruling would be if that happened.
Rugby: half and half, kind of. The referee is almost always within the field of play, and if they impede a player in some way, well, too bad for them. If the ball hits the referee, play is immediately blown dead and restarted with a scrum with the put-in given to the team last in possession. The touch judges are out of play, and supposed to remain outside the field of play. On the off chance one of them wanders inside the field of play and the ball hits them, it's treated as if the ball went into touch. I know that one because I played rugby, and in amateur rugby it's often the case that only a paid referee is assigned to the game, and each team provides one of their reserves as a touch judge. The touch judge that found themselves in the field of play and hit by the ball was me, and I felt pretty stupid for it.
Australian football: 100% in play. Players impeded by an umpire are out of luck and a ball hitting an umpire in the field of play happens sometimes and play continues. The only caveat that I think I know of (I'm reasonably sure of it but not 100% sure) is that if a ball bounces off an umpire and through the inner goal posts, it's given as a behind (1 point) instead of a goal (6 points).
Soccer: the referee is in play, and the assistants should be out of play at all times (not sure what happens on the off chance one wanders into the field of play when they're not supposed to and the ball hits them, unlike what I know about rugby). I would guess that a ball bouncing off a referee and into the goal doesn't count as a goal, but I'm not sure about that one.
Cricket: umpires can accidentally impede players and play continues, but a ball hitting an umpire (whether thrown or batted) is a dead ball. No more runs can be scored at that point, and if the umpire somehow got in the way of a ball thrown at the wicket for a potential run out, too bad. A batted ball that was obviously headed for a boundary before it hit the umpire? Sucks for the batsman, but too bad.
Those are the ones I can think of, at least.