Does Geeta advocate the execution of one's dharma according to the varna system?
Yes. Gita encourages the duty based on own mental inclination. Because if one does not like a Job, one can not perform it perfectly. This selection of a profession based on likeness or own mental inclination is known as Varna system - Svabhavaja Karma or Guna Karma. Gita does not preach birth based Karma - Janmaja Karma.
During Krishna time caste system was definitely prevalent as mentioned in Mahabharat and Srimad Bhagavatam. In Gita, Arjuna was afraid of Varna-shankara. Jati based discrimination was present. It is evident from the plight of Karna, Dharmavyadha, Vidura, Ekalavya etc. Even if they were learned in society, they were deprived from social dignity due to their birth. Vidura was the then prime-minister of India, still he was considered as a Shudra, son of a maid. To correct this birth based division [Jati system], krishna mentioned in Gita 4.13 - caste is really based on Guna-Karma [by profession, not by birth]. But Indians could not appreciate Krishna's amendment till today. Unfortunately today in our society the caste division is not based on quality or action, rather it is based on birth (hereditary).
Context of Varna system in Gita
In Gita, Arjuna was in fear of Varna-sankara in chapter 1 due to rigid caste system. Just imagine, such a high calibre warrior of India Arjuna was having wrong notion about intercaste marriage. He considered, it was a sin to do intercaste marriage and gave logic of denial of Pinda dana and fall into heaven etc.
Sloka 1. 39
kula-ksaye pranasyanti kula-dharmah sanatanah
dharme naste kulam krtsnam adharmo 'bhibhavaty uta
With the destruction of dynasty, the eternal family tradition is vanquished, and thus the rest of the family becomes involved in irreligious practice.
adharmabhibhavat krsna pradusyanti kula-striyah
strisu dustasu varsneya jayate varna-sankarah
When irreligious is prominent in the family, O Kṛiṣṇa, the women of the family become corrupt, and from the degradation of womanhood, O descendant of Vṛṣṇi, comes unwanted progeny.
sankaro narakayaiva kula-ghnanam kulasya ca
patanti pitaro hy esam lupta-pindodaka-kriyah
When there is increase of unwanted population, a hellish situation is created both for the family and for those who destroy the family tradition. In such corrupt families, there is no offering of oblations of food and water to the ancestors.
dosair etaih kula-ghnanam varna-sankara-karakaih
utsadyante jati-dharmah kula-dharmas ca sasvatah
Due to the evil deeds of the destroyers of family tradition, all kinds of family rituals and customs are devastated.
utsanna-kula-dharmanam manusyanam janardana
narake niyatam vaso bhavatity anususruma
O Krishna, maintainer of the people, I have heard from elders that those who destroy family traditions dwell always in hell.
aho bata mahat papam kartum vyavasita vayam
yad rajya-sukha-lobhena hantum sva-janam udyatah
Alas, how strange it is that we are preparing to commit greatly sinful acts, driven by the desire to enjoy royal happiness.
Clarification of Krishna
Krishna wanted to clarify these doubts on caste system and intercaste marriage related issues. He talked of a duty system based on personal likeness and mental tendencies.
catur-varnyam maya srstam guna-karma-vibhagasah
tasya kartaram api mam viddhy akartaram avyayam
Human society is divided into four Varna e.g. Brahmana(intellectuals), Kshatriya(rulers), Vaishya(businessman/industrialist), Sudra(laborers/servants) based on individual quality and action.
brahmana-ksatriya-visam sudranam ca parantapa
karmani pravibhaktani svabhava-prabhavair gunaih
Brahmanas, ksatriyas, vaisyas and sudras are distinguished by their qualities of work, O Orjuna, in accordance with the modes of nature or metal inclination.
samo damas tapah saucam ksantir arjavam eva ca
jnanam vijnanam astikyam brahma-karma svabhava-jam
Peacefulness, self-control, austerity, purity, tolerance, honesty, wisdom, knowledge, and religiousness--these are the qualities by which the “brahmanas(like monks and spiritual leaders)” work.
sauryam tejo dhrtir daksyam yuddhe capy apalayanam
danam isvara-bhavas ca ksatram karma svabhava-jam
Heroism, power, determination, resourcefulness, courage in battle, generosity, and leadership are the qualities of work for the ksatriyas (like manager, politician Job).
krsi-go-raksya-vanijyam vaisya-karma svabhava-jam
paricaryatmakam karma sudrasyapi svabhava-jam
Farming, cow protection and business are the qualities of work for the vaisyas, and for the sudras there is labor and service to others.
Controversies of Gita Varna system
Few criticize Gita Varna system due to below two slokas.
mam hi partha vyapasritya ye 'pi syuh papa-yonayah striyo vaisyas tatha sudras te 'pi yanti param gatim
O son of Prtha, those who take shelter in Me, though they be of lower birth--women, vaisyas [merchants], as well as sudras [workers]--can approach the supreme destination.
In Dvapara Yuga Women, Vaisyas and Sudras were considered as lower birth [papa yuni]. But Krishna is uplifting them by saying - they can also get knowledge through him. So they are not really lower in his eye.
sreyan sva-dharmo vigunah para-dharmat sv-anusthitat
sva-dharme nidhanam sreyah para-dharmo bhayavahah
It is far better to discharge one's prescribed duties, even though they may be faulty, than another's duties. Destruction in the course of performing one's own duty is better than engaging in another's duties, for to follow another's path is dangerous.
It appears to be a denial of freedom to change the job. But that is not correct. It just prescribes to choose a job based on own mental inclination. Don't select a job based on other's taste or likeness. So it preaches personal independence, equal chance and democracy in a society.
In the light of Hinduism
Hinduism failed to distinguish between cleanliness - which is external -- and holiness - which is internal -- in the context of Dalits. This is the cause of untouchability and rigid caste system in India.
Krishna did not say - Jati vibhāgaśaḥ. And Krishna did not have any anti-Dalit agenda when he said - sva-dharme nidhanaṁ śreyaḥ - Gita 3.35. Caste is not the main purpose of Gita in battlefield. When people are about to die, who cares for caste? Krishna wanted to motivate Arjuna to fight and kill evil minded ones. Krishna just clarified the doubts of Arjuna raised in Gita 1.41 [patanti pitaro hy esamlupta-pindodaka-kriyah] about mass murder, intercaste marriage, Pinda dana, eternal fall in heaven etc.
Krishna did not mention Jati, low-high caste etc. Neither he divides Humans. He gave the 'definition' of division of labours [tasks], not labourers [humans]. And Lord did not apply this principle only to 60 crores Hindus. It must be for 700 crores world population. But we are not able to accept the Guna Karma division of Krishna. We follows birth based division. As Dr Ambedkar said - "Civilized society undoubtedly needs division of labour. But in no civilized society is division of labour accompanied by this unnatural division of labourers into watertight compartments."