Multi-access edge computing (MEC) emerged as a promising network paradigm that provides computation, storage and networking features within the edge of the pervasive mobile radio access network. This paper jointly considers computation offloading and resource allocation problem in device-to-device (D2D)-assisted and non-orthogonal multiple access (NOMA)-empowered MEC systems, where each mobile device (MD) is allowed to execute its task in one of the three ways, i.e., local computing, MEC offloading or D2D offloading. We invoke orthogonal multiple access (OMA) and NOMA schemes for MDs that select D2D offloading mode, allowing them to assign tasks to their peers using OMA or NOMA. The original problem is formulated as an overall energy consumption minimization problem, which proves to be NP-hard, making it intractable to solve optimally. We start from a simple case, OMA case and transform the original problem into two sub-problems, i.e., resource allocation sub-problem and computation offloading sub-problem and propose two heuristic algorithms to obtain the sub-optimal solutions of both sub-problems. Then, for the MDs selecting D2D offloading mode, we conduct user pairing and apply the NOMA scheme. Finally, simulation results demonstrate the efficiency of the proposed scheme when compared with the related schemes.