This paper presents an analysis of the IEEE 802.11ax networks’ coexistence with legacy stations, namely IEEE 802.11ac, IEEE 802.11n, and IEEE 802.11a. The IEEE 802.11ax standard introduces several new features that can enhance network performance and capacity. The legacy devices that do not support these features will continue to coexist with newer devices, creating a mixed network environment. This usually leads to a deterioration in the overall performance of such networks; therefore, in the paper, we want to show how we can reduce the negative impact of legacy devices. In this study, we investigate the performance of mixed networks by applying various parameters to both the MAC and PHY layers. We focus on evaluating the impact of the BSS coloring mechanism introduced to the IEEE 802.11ax standard on network performance. We also examine the impact of A-MPDU and A-MSDU aggregations on network efficiency. Through simulations, we analyze the typical performance metrics such as throughput, mean packet delay, and packet loss of mixed networks with different topologies and configurations. Our findings indicate that implementing the BSS coloring mechanism in dense networks can increase throughput by up to 43%. We also show that the presence of legacy devices in the network disrupts the functioning of this mechanism. To address this, we recommend using an aggregation technique, which can improve throughput by up to 79%. The presented research revealed that it is possible to optimize the performance of mixed IEEE 802.11ax networks.