On TV, Movies, and books a great deal is often made of matching a bullet to a gun by the grooves on the bullet.
What is the case for shotgun blasts? Obviously there are no grooves - is there some way of analyzing the makeup of the metal in the pellets (besides the pellet size) to match it with a box of unused shells? Or at least an ability to rule out a match?
You could possibly rule out a match, but production runs on shells are so large that it would be impossible to confirm a match to a particular box. Add to circumstantial evidence, sure (one shot fired, this brand of shell, suspect has a box of same with one shell missing, etc.) but not confirm.
Could it be possible to match a spent shell to a particular gun by examining the casing? Would a firing pin leave a distinct enough mark on the head and primer?
Very much so, and matching shells to firing pins has a long history. Not just the firing pin, but every part of the gun that comes unto contact with the brass leaves its “fingerprint.” From here:
Taking it a step forward, a system of engraving an ID number on a firing pin has been developed so that every primer gets stamped with the number of the gun that fired it. California will require it on all new guns sold in the state starting in 2010.
Assuming you have a spent casing to begin with. That’s where most of this stuff falls apart. If you use a revolver or a side-by-side/over/under shotgun, there won’t be any shells left at the crime scene in the first place.
And normal firing pin matching assumes you have what you believe is the murder weapon, though it can be used to associate spent casings with a specific, if unknown, weapon. This was used to track movements during the Battle of the Little Bighorn.
And I’m sure there will be a brisk trade in replacement firing pins.
Fortunately, most people who would benefit from that belong to a group not known for thinking things through.
Like the gangbangers who videotaped themselves doing a driveby. The cops appreciated the evidence. 
God, I love stupid people.