Yes, but it depends.
To understand the "it depends" we have to discuss how the transporter works.
According to the Starfleet Technical Manual, during beam up the subject is put into an "annular confinement beam" which begins at the moment the "transporter special effect" starts. This confinement beam is supposed to hold the subject immobile while the ship makes a complete sub-atomic scan of the object, during which the object is disintigrated. The "de-molecularization" process doesn't destroy the object, as the object is placed into a "pattern buffer." This pattern buffer is then "played back" on the transporter destination, "re-molecularizing" the transported object.
In a way, the object being transported is never "destroyed," it's just converted into an analog signal and then reconstructed. This is how they get around the massive power requirements to disintigrate and reintrigate the object.
(Side note, this is why Barclay is aware during transporter in Realm of Fear. You're not vaporized, you are simultaneously in three places: the transporter room, the pattern buffer, and the destination. What you see during transport is a mish-mash of all three, because the object being transported is a complex system which is kept in sync with the transporter signal. You never "die" during transport, unless some outside agency interferes or the transporter itself malfunctions.)
This is all the earliest transporters did. Deconstruct, receive, buffer, transmit, reconstruct, with the only power necessary being that to convert the object. The side effect of this is that the transporter victim is stuck for multiple seconds, unable to move, while outside effects can still impact them. The objects transported could end up with additional objects embedded inside themselves (Strange New World, ENT) or could take fatal damage from weapons.
Objects entering the annular confinement beam during initial lock and deconstruction would also be sent to the pattern buffer, with it's quantum state overlaying the object being transported. Weapons fire early enough in the transport process could cause tissue damage during the scan phase which would then be transmitted during the actual transport.
In either of these cases, the problem is that transport is not instantaneous, but there are times when the object being transported is not completely in one place or another. If enough of the object is tangible, you can cause damage.
In the case of Star Trek 6, the Klingons didn't open fire until the "receive" part of the process was fully underway. Personnel transporters by this time contained "checksum" information about crew members (called a "transporter trace" or a "bio record" or the like), which would allow it to "correct" corrupted signal during the transport. As long as the transport had gone "far enough," any damage would be silently repaired, with the victim none the wiser. During that beam out, those shots fired were likely only hitting the very few particles left materialized at that point. The transporter could correct the errors with the "Heisenberg Device" that does quantum mumbo jumbo to make detecting (and correcting) all quantum values of all particles possible.
In the case of Voyager, Chakotay would throw the chair to distract the guard just in case. Even in the 24th century, transporters were still dangerous in "error conditions," despite upgrades like the biofilter and improved checksum data (it could even turn you into kids and revert you! But we don't talk about Rascals.) As long as "error conditions" don't happen, you're safe as houses. But if somebody fires a weapon at you at the wrong time, it can still cause damage, disrupt the signal, or even cause the transporter failsafes to cancel transport! And you don't want that at gunpoint just after an escape attempt.
In "The Most Toys," Data decides to shoot Fajo just as the transporter begins. You can see the weapon fire and begin to create a beam just as the transporter lock completes and the dematerialization happens. Transporters have to transport EVERYTHING, including energy, so the weapon's beam is transported as well (being inside the beam ACB). However, this is shown as an error condition in the Transporter Room... luckily it's the 24th century and the computers have the ability to "edit out" anomalous energy discharges like this. It's possible that the Transporter was asking permission to abort, but O'Brein was able to bypass that and get Data over anyway.
Considering the number of disaster situations where the transporter is used, it's surprising it works as well as it does in a pinch; although it's possible that Transporter technology just had layers and layers of failsafes and error correction built over the centuries. Like how modern day airliners are made safer after every crash, because we learn something we didn't know about flight... every Transporter accident teaches us something about the side effects of slurping patterns of quantum mechanics from one location to another, and therefore we add a layer of safety to the technology.
This is specifically mentioned in the Star Trek novel The Final Reflection, which takes place in the Klingon Empire. The UFP shows off their prototype Transporter to show off to the Klingon Empire, and tells Commander Krenn to tell his superiors about the technology. Krenn replies "Of course. They'll want to know why it makes that horrible noise." as he and his crew is beamed out by the Klingon's advanced silent teleporter technology. The book goes on to discuss the reason Federation teleporters are so noisy: they have extra layers safety features to ensure the security of the transferred patterns, but these layers cause the transporter to run slower and make lots of noise. It's why Klingon transporters in TOS go faster and make no noise; they've intentionally left out safety features due to the expectation to use the transporter in combat, where speed and silence is more important than a few percentage points of safety during "error conditions" which usually don't happen.
Finally, you ask how long you are vulnerable. The answer depends on the specific transporter technology, as some are faster than others, and we don't have exact details on most Federation transporters either. The Starfleet Technical Manual for the Galaxy Class ship does list the transport time as five seconds, from initiation through transmission, buffering, and reconstruction. About a second of that you would be completely vulnerable while scanning before the actual dematerialization takes place, and from that point, the danger posed by weapons fire or external objects diminishes rapidly, as more of your signal has been received and buffered. The more signal in the buffer, the better job the transporter can do to "correct" any signal disruption caused by weapons fire, or solar flares, or exploding starships. I'd guess you're fine after about two seconds; before that you'll likely come out with some sort of damage, and then you've left the engineering department in a site-to-site to medical.