Hitscan attacks hit or miss their target the very moment the attack is launched, and therefore cannot be dodged. All bullet and player mêlée work like this; there are no projectiles involved, invisible or otherwise. However, there is a line calculation to make sure the attack can connect, this is during this that the autoaim intervenes to change the angle and slope of the line.
For monsters, the autoaiming mechanism can have strange effects: the monster will aim horizontally at its enemy (generally, the player), but then the line slope computation will aim vertically at the nearest possible target along that line. As a result, it is possible for a monster to accidentally hit another monster than was not, strictly speaking, in between it and its target; for example if a flying monster stands above the battlefield. (Note, however, that monster mêlée attacks work with a simple distance check rather than a hitscan line computation. For this reason, monster melee attacks never accidentally harm anything else than their intended target.)
ZDoom deviates from vanilla Doom a bit in that the maximum ranged attack distance for the player is increased from 2048 map units to 8192 map units. Furthermore, the damage formula for monster and player hitscan attack can be anything thanks to DECORATE's flexibility.