If the opponent comitts a foul, the incomming player gets ball in hand (BIH), and can place the CB anywhere on the table before shooting. The only requirement is that he not commit a foul while placing the ball on the table.
But It is virtualy impossible to place the CB in such a position that a shot cannot be played.
For expample: All the OB are down table and the CB is up table touching an opponents OB. The shooter can use the up-table end rail and attempt a shot on one of his balls. These shots are called kick shots.
A similar example: Balls as above, but the CB is a couple of mm away from the opponents OB. At this point, one skilled in the jump shot can jump the CB ball over the OOB and attempt a shot on his balls.
An example that actually happened in a tourneyment: Durring play the last OB of a player was completely surrounded by OOBs such that the CB could not make legal contact. The player jumped the CB and landed on his OB first, breaking it out -- thereby avoiding a foul.
So, you need to learn how to make kick shots (CB off one or more rails) and jump shots and massé shots to have a complete set of skills on the pool table.