An official standing inbounds is inbounds. Does a ball come into play when thrown off such an official, as it does when thrown off an opponent?
No. The official is the same as the floor they are standing on. If they are standing out of bounds the ball is out of bounds and the other team's ball at original throw in spot. If the referee is in bounds it can legally hit the official but the player throwing it in can't be the first to touch the ball - hitting the ref doesn't suffice and again the other team's ball.
So you could throw it off the ref if it hits someone else after... but really... in all levels of basketball the only ref near the person throwing the ball in is out of bounds and the only ref on the court is 30-60 feet away. So this question has no point practically speaking. A ref being hit by a throw in that far away is hard to imagine as the ref would just jump out of bounds. And this doesn't account for how the person throwing it in would throw a ball 50 feet, ref doesn't move, hits ref, and then player that threw it in is the first to touch the ball. Has never happened.
In the NBA Rules, neither officials nor players are mentioned explicitly in the throw-in rule. The portions of the rule that most would match this situation are:
8.II.c The ball is caused to go out-of-bounds by the last player to touch it (including by touching the player’s hair or uniform) before it goes out, provided it is out-of-bounds because of touching something other than a player.
8.III.f A throw-in which touches the floor, or any object on or outside the boundary line, or touches anything above the playing surface is a violation. The ball must be thrown directly inbounds.
In general, I assume officials are treated as another portion of the playing environment and the ball striking one would be the same as the floor at that location.
So, if the ball struck only the floor (or official) and then went out of bounds, it's out of bounds off the throw-in player and you have a change of possession. A ball striking the official doesn't change which team is controlling the ball for out-of-bounds purposes.
In addition as Tom Mercer said in a comment, on a throw-in the officials would not normally be standing inbounds. So this shouldn't be possible to accomplish anyway.