That would be illegal and considered interference.
A player should not : b. Touch any ball from within the playing area when it is above the basket ring and within the imaginary cylinder.
g. Touch the ball at any time with a hand which is through the basket ring.
i. Touch the rim, net or ball while the ball is in the net, preventing it from clearing the basket.
PENALTY: If the violation is at the opponent’s basket, the offended team is awarded two points, if the attempt is from the two point zone and three points if it is from the three point zone. The crediting of the score and subsequent procedure is the same as if the awarded score has resulted from the ball having gone through the basket, except that the official shall hand the ball to a player of the team entitled to the throw-in. If the violation is at a team’s own basket, no points can be scored and the ball is awarded to the offended team at the free throw line extended on either sideline. If...