According to FIBA rules this is clearly not OK; in summary, the rules state it in simple terms that until the ball has left the hands of the thrower it is still out of play and it's the defenders responsibility to stay out of contact with the ball or the thrower.
Below is an excerpt from FIBA Official Basketball Rules 2012 (Article 17)
Statement 1
Before the thrower-in has released the ball on a
throw-in, it is possible that the throwing-in motion could cause that
player’s hand(s) with the ball to break the plane of the boundary line
separating the in-bounds area from the out-of-bounds area. In such
situations, it continues to be the responsibility of the defensive
player to avoid interfering with the throw-in by contacting the ball
while it is still in the hands of the thrower-in.
Example: A4 is
awarded a throw-in. While holding the ball, A4’s hand(s) crosses the
plane of the boundary line so that the ball is above the in-bounds
area. B4 grabs the ball that is in A4’s hand(s) or taps the ball out
of A4’s hand(s) without causing any physical contact against A4.
Interpretation: B4 has interfered with the throw-in, thereby delaying
the resuming of the game. A warning shall be given to B4 and
communicated to coach B and this warning shall apply to all team B
players for the remainder of the game. Any repetition of a similar
action by any team B player may result in a technical foul
I could not find an explicit description of this situation in the NBA rulebook, particularly Rule #8 which governs out-of-bounds and throw-ins. However, it is clearly stated that the ball is out-of-bounds if it's in contact with a player who's out-of-bounds, which the thrower has to be. Thus the ball is not in play until the thrower releases the ball, thus a "sneak-steal" should presumably not be allowed.
Section I-Player
The player is out-of-bounds when he touches the floor
or any object on or outside a boundary. For location of a player in
the air, his position is that from which he last touched the floor.
Section II-Ball
a. The ball is out-of-bounds when it touches a player
who is out-of-bounds or any other person, the floor, or any object on,
above or outside of a boundary or the supports or back of the
backboard.
It is worth noting that, according to FIBA rules, the player who's given the ball to throw in may not bounce (or drop) the ball inbounds and touch it again, before the ball is touched by another player. In other words if the ball slips out of the hands of the thrower, and bounces inbounds, it's fair game for the defender to take the ball and advance. (see Article 17, Statement 7)