Yes, avocado seeds need sunlight in order to germinate.
If you are growing an avocado tree from seedlings, you will need to plant them in soil that is well-drained and has good drainage. It should have decent amounts of organic matter mixed into it. You should also find a warm spot with full sun exposure so that the young plants will get plenty of sun.