Using the presented scenario:
Legacy mentioned it, but I can see some folks not catching the "drift."
The option of penalizing 5 yards for the KOB foul to the spot where the ball belongs to Team B means exactly that, and only that. The spot where the dead-ball belongs to team B, in this example, is the out-of-bounds spot. So, Team B can have the 5 yard penalty enforced from that spot (A-45), taking the ball to the A-40, 1st down for Team B. There are no other situations in which the 5-yard penalty may be 'added' to some other spot.
The other penalty options are:
-Team B may have the 5-yard penalty enforced at the previous spot (A-35), and the kickoff repeated from the A-30
-Team B may take the ball, 1/10, thirty (30) yards from the previous spot (A-35), 1/10, B-35.
-Team B may decline the penalty and take the ball at the dead-ball spot (A-45), 1/10.
A no brainer (except in some unusual time-critical situations). B, 1/10, A-40.
To modify the situation a bit, let's say the ball was batted by A22 at the A-44. Then the batting would also be illegal touching. Team B would have yet another option, i.e., to take the ball at the spot of the illegal touching A-44). But, if they take the ball at the spot of illegal touching, the 5-yard KOB penalty may NOT also be enforced. (I see that mistake made by some inexperienced TASO crews. They add 5 yards to the illegal touching spot. WRONG!) In this situation, Team B would still take the 5-yard penalty from the spot where the dead-ball belonged to them, to get 1/10, B-40.