Hi, I recommend reading these scholarly works on the ethnic situation on the southern Chinese frontier during the first millennium. During the first millennium, Jiaozhi and all of the other southern Chinese provinces consisted of a mixture of peoples designated as "civilized", "semi-civilized" (Li) and "barbarian" (Liao). No document recorded any distinction between the demographic or cultural composition in the future Vietnamese area and the future South China, and all tribes living between the Pearl River Delta and the Red River were essentially identical. Furthermore, the people living within the Red River Valley were closely related or even the same families as those Chinese aristocrats in the Pearl River Delta cities. They were non-rebellious for long periods in the first millennium, unlike the hill tribes. Even when there were rebellions, they tended to be led by charismatic men who were originally seeking high ranks in the Chinese court, or protecting their families' existing rank from centralization by the Imperial family. The divergence between South China and "Vietnam" only started when the Liang dynasty diverted trade from the port at Thanh Hoa to Guangzhou, causing the whole area southwest of Guangzhou to become useless to the central government and also increasingly autonomous, while the rest of south China became more centralized.The fact that the Baiyue were composed of many different ethnic groups is irrelevant. Collectively, the Han Chinese recognized them as a very different and foreign grouping of people, and displaced them during Han dynasty's conquest of the South. This recognizable difference between Northern East Asian Han Chinese and Southern East Asian Baiyue peoples explains why despite continuous efforts at cultural assimilation and subjugation, the Vietnamese resisted and rose up in constant rebellions.
Genetic differences between Han Chinese and the Vietnamese are quite significant. Han Chinese are almost entirely Northern East Asian, while Vietnamese are predominantly Southern East Asian with some degree of Northern East Asian admixture. In the case of Turkey, the number of Turkic conquerors were very small compared to the population of the original inhabitants in the area, and the Turks assimilated themselves into the native population within the span of just a few generations. It's funny that Turkey views themselves as the leaders of Pan-Turkic Ethno-nationalism, when the Turkish people themselves are not really Turkic at all. It's like Indians believing themselves to be the original Aryans.
This is the era before Nationalism; all states were created on the basis of the rulers' personal family relationships, not the customs or genes of the population. According to linguistic analysis, there was a unique local Southern Chinese dialect spoken in the Red River Valley, different from any other form of Chinese, up until the 10th century when it fused with the proto-Muong languages to form the Vietnamese language. This means that there were large numbers of local-born people in the 1st Millennium Red River Valley who were not natives but also divergent from the Imperial court, and they later mixed with the natives to form the Vietnamese people.
All Southern Chinese have considerable southeast Asian admixture, as indicated by the low levels of the same haplogroup as Northerners. Some Han samples from specific areas have even lower levels than the Hanoi average.