Can I use coconut oil instead of ghee in curry?
Coconut oil is used quite regularly in the southern part of India. It completely replaces ghee or sunflower oil in certain dishes. And as Chris pointed out, it definitely changes the overall flavor of your dish and it may not be a bad thing if it doesn't conflict with the rest of the flavor profile.
As for the original question of frying onions, you surely can but they don't end up very crispy but on caramelization you have a sweet, soft textured onion.