No, it is not necessary to have studied the subject in Graduation to opt it as a optional. A candidate can choose any subject for optional section from the provided list of subjects.