>>314880357Depends on how magic works. D&D, not unless they knew the bullet was coming beforehand, so they can set up protective spells. But even if a wizard could conjure up a spell in a split second, it might still not be able to protect him as a bullet would be travelling very fast.
That being said, he might not have to worry. At Waterloo, more than half a millenium after the first gun was invented, the typical smoothbore gun the British and French used had a 3% chance of actually hitting a dude at 100 yards, though this improved to around 20% at 50 yards. This incidentally, is why marching up to dudes and then firing away was the cornerstone of infantry tactics up to the US Civil War and for some time beyond.
However, if the sniper is using a rifled barrel (v.expensive until industrial mechanization took off) then he doesn't have a chance unless he's Neo.