As everyone mentioned, a normal stroke directly at a frozen ball pair is legal.
However, some local tournaments, leagues, etc, will make you shoot away from the balls, and/or jack up to 45 deg, anytime the balls are within a chalk distance or similar. Then, whatever happens next, is legal. This is purely to avoid arguments and necessitating experienced refs.
I saw this first hand at a high level, open, regional tournament. It was a Mezz event in Philadelphia about 15 years ago. $75 - $100 entry range and no one is barred, 64 player field. The finals were between two fargo 730 range players. It was 4am, and the tournament director went home, and only a few railbirds left. The shooter landed straight on the 9, close to the corner, but about a chalk width away. Any good player would have won the game shooting jacked up. The rule on this regional tour, however, was if the balls were that close, you must shoot away no matter what. The player went to shoot it jacked up and straight in for the win, and the opponent stopped him and said the rule is to shoot away. The shooter said are you kidding? But that was the rule. So the player shot away in a safe, and lost from there.