Can an individual gear/cog on the rear cassette be replaced?
According to the late great Sheldon Brown, yes you can change an individual sprocket in a cassette, at least for Shimano.  Some cassettes have small bolts or rivets holding the gears together, but this is for convenience.

Most Shimano cassettes made in the '90s or later have a feature called Hyperglide (probably a registered trademark) that enables smoother shifts, by allowing the chain to engage two adjacent sprockets simultaneously.  Hyperglide works by giving each individual tooth a more complicated shape to facilitate shifts to and from each sprocket.  In order for Hyperglide to work, the adjacent gears have to be carefully matched to each other.  So if you change a sprocket for another sprocket with a different number of teeth, then shifts to and from that sprocket won't be as smooth.  But as Sheldon pointed out, that's what everyone was used to for decades before the invention of Hyperglide, so that needn't bother you.

I haven't been able to find anything on Sheldon's site about changing sprockets for Campagnolo or SRAM, but I would assume that those brands shape their sprocket teeth similar to the way Shimano do, and so similar concerns must apply for those brands also.

Personally, if a few of the sprockets in my cassette were worn, I would just change the whole cassette (and the chain also of course).  You're unlikely to save any money or hassle by just changing one or two sprockets, because the vast majority of bike riders change the whole cassette.  Most people who want to change just one or two sprockets want a particular combination of gear ratios for specific reasons.