The application of device-to-device (D2D) communication and multi-carrier (MC) non-orthogonal multiple access (NOMA) have been considered as promising technologies to enhance energy efficiency, network connectivity, and spectrum efficiency in the next generation of communication systems. This paper investigates a joint optimization problem of spectrum-efficient mode selection, fair sub-channel (SC) allocation, and power allocation of user pairs for a D2D-enabled MC-NOMA network. In the proposed network, user pairs are enabled to transmit and receive data in either underlaid D2D mode or cellular mode, and the NOMA technique is adopted in both downlink and uplink transmission. To maximize the throughput of the system and to manage the co-channel interference, the joint optimization problem is formulated under the constraint of guaranteeing all users with a certain amount of resources while satisfying the minimum signal-to-interference-plus-noise ratio (SINR) requirements of users. As an NP-hard problem, the optimization problem is first transformed into two sub-problems namely 1- the joint SC allocation and mode selection and 2- the power allocation. Then, to jointly solve the SC allocation and mode selection sub-problem, an enhanced three-side many-to-one matching algorithm is proposed and to obtain the solution to the power allocation problem, the known sequential convex programming method is used. Moreover, an iterative algorithm is used to enhance the performance of the system in terms of sum-rate. Finally, a mathematical expression is introduced to check the quality of service (QoS) of the proposed fair resource allocation algorithm and the results of the simulation are stated to indicate improved system performance.