In what other sport can you foul a team to your own advantage? In football, penalties are optional. You can accept or decline.
You should be able to accept or decline free throws, at least in the last 2 minutes. If you decline, you get the ball out of bounds with a 10 second runoff.
Simple solution. Fouling at the end of games to your own advantage is unwatchable. It can't be good for basketball.
Change the rule and the game gets better. Winning teams win and losing teams lose.
(Until then, take Dok out of the effing game!)