Short answer
Yes, according to many contemporary scholars. The cap and gown began in medieval European universities, but today people of every faith wear them as academic dress, and they are not a religious symbol. Women keep their hijab under the cap, and no one should join any religious ritual held at the ceremony.
Imitation is forbidden in what is specific to another religion or its rites. Academic dress no longer marks any religion, so wearing it is permissible, though some Hanafi muftis advise avoiding it where possible because of its origins.
The four schools agree on this.
Explanation
The Prophet ﷺ said that whoever imitates a people is one of them. Ibn Abidin explains that the blame falls on imitating what is blameworthy or what is distinctive of another faith, done to look like its people. It does not cover everything that non-Muslims also use; see is it haram to dress like non-Muslims.
Academic gowns grew out of the dress of medieval universities, which were run by churches. But for centuries they have been the dress of universities everywhere, including in Muslim countries, and no one wearing one today is seen as showing a Christian identity. For this reason many muftis allow it. Some are more cautious about the origins and prefer that you avoid it where you can, which is also a sound choice.
- Women: wear your hijab and put the cap on top, or ask if the university allows a scarf instead.
- The ceremony: attending is fine. If it is held in a church or includes a prayer, do not take part in the worship itself; see attending a church wedding for the same principles.
- Handshakes: if officials shake hands across genders, a polite nod or hand on the heart is enough.
Your degree is a blessing; thank Allah for it and keep your intention that the knowledge benefits people.
The evidence
Sunan Abi Dawud 4031
Graded hasan sahih... من تشبه بقوم فهو منهم ...
"Whoever imitates a people is one of them."
The basis of the rule against copying what is distinctive of another religion.
Where the ruling is recorded
- Radd al-Muhtar (Ibn Abidin), Kitab al-Salah, chapter on what is disliked in prayer, discussion of imitation. Imitation is blameworthy only in what is blameworthy or intended to resemble another people.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.