Yes, but olive oil has a low smoke point and is not used for the same applications. Otherwise I'd happily use it for everything.
However, if the pan only has a couple onion slices, or there's more oil than onions, or the heat is way too high, the situation changes. You can also overheat high-smoke-point oils if you're not careful. Careful observation and regulation of environmental factors is necessary in all cases.