I use hydrogen peroxide a lot, especially for pet-related things. It’s one of those things I always have on hand.
Straight ammonia, I’ll admit, I don’t use a lot of. I’m a bleach fan (sorry, anti-bleachers), and since you can’t use the two together, bleach usually wins. Windex (which is ammonia-based), though, is a particular favorite of mine for glass and metal.
OxiClean is pretty great for this, or you can try pre-soaking the pillowcase in a sinkful of warm water and dish soap (the kind designed to cut through grease!), then a good rinse and launder as usual.