Can player B touch the ball in any of these situastions? The ball is traveling to the opponents field after receive. Setter A is close to the ball. Blocker B is not putting their hands over the net in any of these situations.
The most important rule here is Rule 9, "Playing the ball":
Each team must play within its own playing area and space
As such, B is perfectly entitled to play the ball as shown in both your diagrams. In your top diagram, A is also entitled to play the part of the ball which is on their side of the net - this could lead to a simultaneous contact which is covered by Rule 9.1.2 if you want the details.
In your second diagram, A is playing the ball outside their own playing area, so will commit a fault if they actually touch the ball (or player B). Quoting Rule 11.4.1, which lists the faults a player may commit at the net:
A player touches the ball or an opponent in the opponent's space before or during the opponent’s attack hit.