Can I use a 3x10 or 3x9 speed (front) chainring in a 3x8 speed drive? I'm having a hard time finding a new 42T chainring to replace the old one in my 3x8 speed drive, and the only option seems to be to go with a 42T chainring designated for 3x10 speed setups. Anybody knows if it would work and how well? Would it be better to use a 44T chainring intended for 3x9 drives?
In almost all cases it can be made to work fine. The trick to getting there is that because the ring can be a little thinner due to the the narrower ring-to-ring spacing of the crank it's intended for, you sometimes need tiny little chainring spacers/shims to get the centerline of the ring spaced where you want it to be. With a large ring, the other issue that often comes up if you don't have them is the chain may rub on the inside of the new large ring when you're in the middle ring, small cog combos. It's pretty common to see this being the main functional issue in practice.

The main flavor of tiny chainring spacers available are the 0.6mm ones from Wheels Mfg and a couple other brands. On paper the .6 can seem like too much, but in practice they tend to work great in scenarios like the one you're in. 0.1mm spacers exist and can be useful for getting things stone perfect, but they're not a standard bike industry item and aren't usually needed. You can get them from industrial suppliers (McMaster etc) if needed. The 0.1s are probably a little more under the radar in the bike world than they should be in terms of usefulness.

The other factor is how well the ramps and pins play together. Usually you don't really have a lot of choices here and it works fine anyway, probably because despite being ostensibly different systems, manufacturers have fairly similar ideas about where in the rotation cycle to locate them. (That is my speculation.) I often gravitate towards using rings intended to be generic replacements, such as the ramped and pinned ones from US distributor house brands Origin8 and Dimension, and tend to get fine results with those. On the other hand, for commuter bikes with 104/64 BCD in particular I often try first the Deore/Alivio level steel rings from Shimano, which are cheap, work good, last a very long time, and can usually be made to work well on any crank of the right BCD.