It's not specifically against the rules as far as I know, although if the referee were to believe a player was being deliberately "unsporting" then they can issue a warning and if there is any further such conduct they can award the frame to the opponent.
Additionally however the rules do have measures in place to safeguard against this (and other forms of deliberate fouls to gain positional advantage). Primarily, the non-offending player can elect to have the other take the next stroke (in some instances they can optionally have the balls returned to the previous placement as well), thus negating the "safety" of the position they used the foul to leave, and in the rules in section 3.12 of the WPBSA rules:
Snookered After a Foul
After a foul, if the cue-ball is snookered (see Section 2 Rule 17),
the referee shall call FREE BALL.
means that even if the non-offending player chose to play on (and were snookered) they can nullify that snooker anyway.