You were right about clean hands.
1A. Double foul. B did not get the ball with clean hands, so we have a double foul, offsetting penalties, replay the down.
1B. Since B did get the ball with clean hands, they can decline A's foul, and keep the ball, with the penalty being enforced against them under ABO. Since the foul was behind the end of the run, enforce from the A35. B's ball, 1st and 10.
2. Same as 1B. It doesn't matter when A fouled, it matters when B fouled. SInce it was after the COP, they can keep the ball by declining A's foul. If they foolishly (under most circumstances) accept, you have a double foul, and you replay the down.
It pretty much comes down to "clean hands".