Pornography is legal. It is OK to pay actors to have sex.
Prostitution is illegal. It is not OK to pay someone for sex.
If I were a porn producer/director, and I star in my own films, it is legal to pay an actress to have sex with me in front of the camera, but it will be illegal to pay the same "actress" to have sex with me without the camera!