In Star Trek IV: The Voyage Home, whale biologist Gillian grabs onto Kirk while he is beamed aboard the Klingon Bird-of-Prey. They both are successfully transported on to the ship, fully intact. In-universe, is this actually possible, or should they have been fused together into one person when their molecules recombined in the transporter room?
We regularly see characters beam up and down while carrying equipment and even organic life forms without getting molecularly fused to them, so the transporter can clearly deal with these situations. Technically, the very scene you're referring to is effectively the proof that this is not a big deal in-universe. We know they wouldn't get fused together simply because they didn't. But I'll answer this as if that scene never happened and we want to know whether it would've been safe based on the rest of canon.
Short answer: In the ENT era this was a very serious risk, and people could die from being fused with other objects caught up in the transportation. But there is strong circumstancial evidence that by the TOS era the technology was safe enough that Gillian and Kirk were probably not in any danger.
In Enterprise, the danger is demonstrated quite clearly by this incident from Strange New World:
ARCHER [OC]: Looks like our only choice.
REED: Understood. Stand by.
(He begins beaming Ethan up.)
REED: There's a problem, sir. There are contaminants in the matter stream. The phase discriminator can't seem to isolate the debris.
(Ethan finally materialises with twigs and leaves stuck on him.)
REED: Reed to Sickbay. Medical emergency.
Ethan does survive this, but probably only because these were mere leaves and twigs.
As for TOS, the most useful facts I can gather are:
The simple fact that transporter use became so commonplace tells us that they must have become much safer. Shuttles only seem to be used in this era when the transporter is unsuitable for some reason (such as range).
When transporter malfunctions did happen, they were not "fusions". In The Enemy Within, the transporter breaks down and creates evil twins of Kirk and a small dog-like alien. In Star Trek: The Motion Picture, a sudden power failure mid-transport causes two crewmen to die screaming in agony, but they remain physically separate during the accident.
In Star Trek VI, when the two assassins in Starfleet uniforms beam out of the Bird of Prey, several drops of Klingon blood are unintentionally transported with them. This tells us that a TOS-era Bird of Prey transporter does not attempt to prevent other objects from entering the beam during transport, and that there is no catastrophic failure when this happens.
Simply being in contact with another organic life form during transportation is definitely safe. It happens as early as The Enemy Within, when Kirk beams up with this space unicorndog thing.
Given all of this, it seems very unlikely that one human grabbing another one mid-transport would be enough to trigger a transporter malfunction that would fuse the two humans together, at least in the 23rd century.
That isn't enough to completely rule out the possibility, since a human is much bigger and more human-like than a blood droplet, and the alien dog was beamed up intentionally while Gillian was not, but I believe that's the strongest case I can make using the movies and TV episodes other than Star Trek IV.
While not directly relevant to the question, there's also evidence that transporters got even safer in later eras.
In TOS: The Naked Time, there is a mention of "decontamination" taking place as a separate procedure after an away team is beamed up. In Voyager, the transporters have "biofilters" which remove some toxins, pathogens and radiation during transport, so transporters must have gotten a lot more powerful by the 24th century.
We also know that by the TNG era, transporters can shield their subjects from external interference after the start of the transport, because of TNG: A Matter of Perspective:
LAFORGE: We are hypothesising that Doctor Apgar energised the converter at the moment of Commander Riker's beam-out, hoping to make his death look like a transporter accident. But something went wrong. The energy pulse hit the transporter beam and reflected back to the reactor, which caused the explosion.
It's evidently a testament to Mr Scott's great skills with the transporters (or possibly dumb luck) that they weren't both horribly injured during transport. The following exchange appears in the film's official novelisation but not in the film:
NOT KNOWING WHAT would happen, not caring, Gillian flung herself into the beam and grabbed Kirk around the waist. She felt him dissolving in her hands.
She felt herself dissolving.
They reappeared in the transpor ter room. "Surprise!" Gillian said.
Kirk glared at her. "Do you know how dangerous-no, how could you? You could have killed both of us. Never mind. Come on, you'll just have to leave again."
There are two parts to your question:
- Was it possible?
- What should the outcome have been?
What wouldn't have happened
First, they would not have been fused. Transporters function on a molecular level, they have to keep atoms separate. The space between two people is gigantic relative to the space between brain neurons. The transporter has to keep those separate.
So assuming the transporter is functioning properly we would not ever see a combined person (as we saw in VOY:Tuvix where the transporter malfunctioned).
Depending on what you want to consider canon we know a lot about transporters. At a basic level we know there is a sort of containment beam that must isolate the object being transported. This beam is very important, when it fails, bad things happen.
One could make the argument that the early transporter, as mentioned by another author, (Ent:Strange New World) must not have had this containment beam, thus the "fusion" issue (but this seems like a bit of a stretch without more evidence).
What we do know is that these "containment beams" (or fields) weren't strong enough to stop Danar from escaping the transporter beam in TNG:The Hunted; they are not impenetrable.
The other factor is that the transporter technology, while clearly similar, may not have been exactly the same on the Klingon Bird of Prey -- so we may not be able to rely on our Starfleet technology examples.
Was it possible? Besides the obvious, (yes, because it happened) it seems entirely possible that she would have been able to join the transport before Kirk's pattern had started to be scanned (or the system, or Scotty, restarted the scanning process before the transport initiated).
What would have happened? What we saw.
If there had been a strong confinement beam in place, we certainly could have expected Gillian to bounce off the beam; being unable to enter the transporter stream.
If the imaging scanners hadn't fully scanned her, we certainly could have expected a rather gruesome outcome for her (though not for Kirk who was always in the beam).
If she had delayed till after the matter stream was active, she might have ended up falling on her butt as she grabbed onto someone who was no longer present.
We didn't see any of that, so we must assume that she was able to grab onto Kirk before the matter stream started and that Scotty (or computer) was able to properly compensate to fully scan and transport her.
This example might not easily transfer to Starfleet because it's Klingon technology (though, they're pretty powerful transporters if they're able to beam up two humpback whales... and all that water).
Dangerous, yes. Possible, yes.
It's all about the timing. We have seen this happen in the TOS episode "The Enterprise Incident" when the Romulan commander jumps on to Spock and is transported with him. There must be a very small window when this is possible. By the time of Next Gen the total transport time is ~5 sechttps://cudebi.files.wordpress.com/2011/06/franchise-star-trek-tng-technical-manual1.pdf so we can infer that in TOS the transport time would be longer and the ACB might allow this kind of thing to happen since we haven't seen this happen in the Next Gen.