Dirac and Majorana edge states in graphene and topological superconductors