With the first situation, the ball is live once it's at the disposal of the inbounder. Your best bet is to tell your players (may be tough to do so) to get away from the ball - that way it doesn't become live.
As for the second situation, it can't be a "shooting" foul, but if B is in the bonus, the player will shoot 1+1 or the 2 bonus shots. No offense to your player, but if A1 is fouling on an attempt at his own goal, the B player deserves free throws.
Now - to throw in a theoretical monkey wrench - team B rebounds, scores a basket, then grabs the ball for the throw-in and scores again (a la the "specific unsporting act" detailed in 10.1.8). We cancel the basket, charge B with a technical foul, and put time back on the clock, but can you say that the ball was never live and go back and correct the free throws?