Under WPA rules, no, it isn't legal. Here's the pdf, but I'll paste 13.5 under "Bank Pool." [p42]
13.5 VALID BANK SHOTS
For a bank shot to be valid, the athlete must indicate the object-ball, one or more cushions in order thatthe ball will contact, and the pocket the object-ball will go into...