I'm pretty sure for a lot of series, it's at least somewhat pre-planned. iirc Taka (known in his porn days as Amagasa Osamu (天笠修) / NAOYA) was working as a rentboy before he did porn (unsubbed Japanese interview:
"My first sex with a man was a customer"), and I expect probably a lot of gay porn models whether gay, straight, or bi were picked up through connections while escorting, depending again on the series. They may even be "assigned" straightness because being straight and especially having your "first experience with a man" is very marketable in gay porn.
(Of course, then you have beautiful gay divas like Shota Inukai being like "every new day is an opportunity to get railed by someone new" (heavily paraphrased).)
I couldn't give you even a ballpark figure for what percent of a video or of a model's image is pre-planned in any given series, but it could be anywhere from all to relatively little.