There is no built-in way to prevent this. Because the game world no longer pauses during conversation as in previous TES games, the ability to exit at any time was kept in case the player or speaker is interrupted by combat.
There is one method that forces the speaker to keep the conversation going if the player exits:
1) Create the dialogue branch that's intended to not be skipped.
2) Set the speaker to use a ForceGreet package. Create conditions so that the speaker keeps entering conversation with the player until the conversation is completed.
3) In the dialogue branch, create an empty topic (enter a single space as the dialogue line) with the following script in the Begin fragment block (using akSpeaker.evaluatePackage() doesn't process fast enough):
4) Connect all topics in the dialogue branch (except for the final dialogue topic in the conversation) to this empty topic. Set the empty topic as the "Walk Away" topic in the dropdown box and tick the "Walk Away Invisible in Menu" option in each.
It's best to use this method only if the area is guaranteed to be clear of enemies. If possible, create four collision planes and set them up as walls and keep them disabled until the conversation needs to start. Then move the player into the center of the collision plane room to prevent them from leaving. Once the conversation is finished, disable the planes.