To supporting a wider and diverse range of applications, device-to-device (D2D) communication is a key enabler in heterogeneous cellular networks (HetCNets). It plays an important role in fulfilling the performance and quality of service (QoS) requirements for 5G networks and beyond. D2D-enabled cellular networks enable user equipment (UE) to communicate directly, without any or with a partial association with base stations (eNBs). Interference management is one of the critical and complex issues in D2D-enabled HetCNets. Despite the wide adoption of D2D communications, there are very few researchers addressing the problems of mode selection (MS), as well as resource allocation for mutual interference in three-tier cellular networks. In this paper, we first identify and analyze three key factors, namely outage probability, signal-to-interference and noise ratio (SINR), and cell density that influence the performance of D2D-enabled HetCNets. We then propose a dynamic algorithm based on a distance-based approach to minimize the interference and to guarantee QoS for both cellular and D2D communication links. Results obtained show that outage probability is improved by 35% and 49% in eNB and SCeNB links, respectively, when compared with traditional neighbor-based methods. The findings reported in this paper provide some insights into interference management in D2D communications that can help network researchers and engineers contribute to further developing next-generation cellular networks.