A muzzle-loaded weapon has several drawbacks when it comes to what we might call 'user safety', especially when we're looking at flintlock weapons rather than later percussion-cap weapons. Loading was a complex process, and getting even a single step wrong could cause the weapon to misfire - whether that means a simple failure to fire (as with lost priming or a failure of a fling), or something more dangerous, like a 'hang-fire' (where the priming ignites, but the main charge does not do so immediately). Further, many muskets were used beyond their 'life expectancy' and were used in ways that decreased their safety.
In the British Army, the issue musket (various models, all commonly referred to as 'Brown Bess') had an expected safe service life of eight to ten years, but this was often complicated by the common practices of soldiers and the exigencies of warfare:
Its [a musket's] barrel was often worn out early by frequent rubbing with wet brick-dust that produced a pleasing shine but removed the metal, rendering it liable to burst. Worse, the sear against which the cock engaged became dangerously worn, so that muskets went off at half-cock, when they were in theory safe, or fired immediately [when] the cock was drawn fully back. In 1774 the 11th Foot carried out a review where the inspecting officer reported 'some Firelocks going off when loading - some upon the Mens' Shoulders'. At Waterloo Lieutenant Strachan of the 73rd, who had just joined the regiment and was anxious to see action, was marching in front of a line of men with their muskets at the trail, carried horizontally, muzzle forwards. A corn-stalk got entangled with the trigger of a half-cock musket, which went off, hitting Strachan in the back and killing him instantly. And, like other small-arms across the ages, the musket was suceptible to accidents caused by tired or careless men. While the soldiers of the 43rd Regiment were cleaning their muskets after the bloody storm of Badajoz a soldier accidentally fired his, killing a corporal on the spot.
[Holmes, 195]
Added to this, there was the problem of what we might call 'normal failure': flints lasted twenty or thirty shots, but broke without warning; the priming might spark, but do no more - a 'flash in the pan'. Further, if a musket had flashed but the soldier did not realise - a real possiblity under fire - he might load another charge on top of his first one. The next shot, being double-charged, was liable to explode, with a predictable effect on the soldier's nearby face.
In French service, things were similar. Charleville muskets had a lead seating that left only the front end of the flint exposed; soldiers sometimes replaced this with cloth to make maintenance easier, but this sometimes caught fire and burned the shooter's hand. Hang-fires occurred at approximately one shot in eighteen (according to Elting, although he doesn't provide a citation for this). A hang-fire was, from the outside, identical to a flash in the pan, but it would leave some powder burning slowly, resulting in delayed discharge. If this went off when you were checking your musket to see what was happening, or had started to unseat your charge with the screw on the reverse end of your ramrod, you might lose your hand.
Some firing practices also resulted in friendly fire. One tactic the French Army experimented with was having the first rank of a battalion kneel during a volley, so the two ranks behind could fire unimpeded. Unfortunately, this could result in first-rank men being shot in the back when they stood up to reload.
(This section courtesy of Elting, 479-481)
As for artillery, burst guns did happen, and were obviously dangerous; this phenomenon tended to decrease as time went on with advances in metallurgy and improvements in the systematisation and standardisation of artillery, but persisted right up to the American Civil War. Further, incorrect loading was an even greater danger when dealing with cannons: if the crew's spongeman failed to adequately extinguish any still-burning powder in the gun, the loader could lose his arms or his life when he put the main charge down the barrel. The ventsman similarly needed to make sure that the weapon's touch-hole was properly stopped as the spongeman rammed the charge, since the pressure effect this caused might ignite remaining embers as the charge went down the barrel. If all crewmembers failed to stand clear as the weapon fired, the gun could crush or break limbs with impact.
Sources:
John R. Elting, Swords Around a Throne: Napoleon's Grande Armée
Richard Holmes, Redcoat: The British Soldier in the Age of Horse and Musket