Writers who don't care about how plausible or even theoretically possible their stories are don't have to read the rest of my answer. But if you want as high a score as possible in the scale of science fiction hardness you may need to read all of my answer.
Long Answer: Which is sort of a frame challenge.
It is impossible to humans to domesticate giant ants, because it is impossible, or almost impossible, for giant ants to exist.
Part One: The Square Cube Law.
A science fiction writer should keep up with the latest discoveries and theories in science. As I remember Galileo Galilei (1564-1642) first wrote about the square-cube law, in Two New Sciences, 1638.
As stated by J. B. S. Haldane, large animals do not look like small animals: an elephant cannot be mistaken for a mouse scaled up in size. This is due to allometric scaling: the bones of an elephant are necessarily proportionately much larger than the bones of a mouse, because they must carry proportionately higher weight. Haldane illustrates this in his seminal 1928 essay On Being the Right Size in referring to allegorical giants: "...consider a man 60 feet high...Giant Pope and Giant Pagan in the illustrated Pilgrim's Progress: ...These monsters...weighed 1000 times as much as [a normal human]. Every square inch of a giant bone had to support 10 times the weight borne by a square inch of human bone. As the average human thigh-bone breaks under about 10 times the human weight, Pope and Pagan would have broken their thighs every time they took a step."5 Consequently, most animals show allometric scaling with increased size, both among species and within a species. The giant creatures seen in monster movies (e.g., Godzilla, King Kong, and Them!) are also unrealistic, given that their sheer size would force them to collapse.
The exoseletons and internal muscles of insects ae less efficient than the endoskeletons and external muscles of vertibrates. So giant ants might be unable to move under 1 g of surface gravity, as on Earth. The tiny ants and other insects on Earth can move under 1 g of surface gravity because of their tiny size. Enlarging their bodies to the sizes of medium sized land mammals would probably make it impossible for them to move and thus to live.
Part Two: Another World
You could set your story on a planet with a lower surface gravity than Earth. That would enable giant ants to be larger. Of course Earth humans on that world would gradually over generations develope thinner bones and muscles, and native intelligent beings would evolve to be less musculer than humans.
It is known that long term stays in the micogravity of orbiting space stations have detrimental effects on humans. Of course a world with only one tenth of Earth surface gavity (0.1 g), or one hundredth (0.01 g), or one thousandth (0.001 g) should have a low enough surface gravity for giant ant species to be able to move around easily, and might possibly hav eenough surface gravity for humans to be healthy in the long term.
But nobody knows what level of surface gravity would be the limit on how low humans can tolerate for all their lives. The only way to find out would be to build permanent bases on worlds with different surface gravities, which owuld be very espensive - or build a rotating space station which would be very expensive but probably much less expensive than many bases on other worlds.
In one of the wheel shaped space stations common in science fiction, the central hub would basically have weightlessness, while the rim of the wheel would rotate at such a speed that the similated gravity in it would be about 1 g, and the similated gravity in the spokes would bet lower and lower the closer to the hub one got. So lab animals could be raised at different distacnes from the hub to see how well they tolerated different levels of similated gravity, and eventually humans could try living at the levels which were safe to the lab animals.
But until that is done, ther is no way to know how low the surface gravity of a world can get consistent with human habitability.
A naturally habitable world for humans would require sufficient escape velocity fo retain its atmosphere for hundreds of millions of years or billions years to for that atmosphere to be enriched with enough oxygen for humans to breathe.
And of course a world with low surface gravity will also have a low escape velocity. Fortunately the surface gravity and escape velocity don't change at the same rate. Specifically, I think that worlds which have a lower overall average density than Earth can surface gravity that is lower compared to Earth's than their escape velocity is compared to Earth.
Thus I can imagine a world with lower mass and lower density than Earth which - for example - has aboout 0.6 the escape velocity of Earth, that might be high enough to retain an oxygen rich atmosphere for geological eras of time, while having a surface gravity that might be 0.3 that of Earth.
But I have not done calculations to see what sort of world might have that surface gravity and escape velocity, and I don't know if a surface gravity of 0.3 g would be high enough for human health and also low enough to have ants giant enough for your question.
If you keep lowering the densities of imaginary worlds, eventually you will have to have their entire surfaces covered with oceans of some liquid that are miles deep, unsuitable surfaces for either humans or ants. And decreasing the density even more would result in planets largely composed of gas, and so having atmospherees too dense for huamns or ants to survive in.
Therefore, it is unknown whether any possible planet with a solid surface could have both a surface gravity low enough for the giant ants (and also high enough for human survival) and an escape velocity high enough to retain a dense and breathable atmosphere for many geological eras of time.
So some writers might want to be careful and set their story in a giant rotating space habitat with many levals. Giant ants might reside in some of the inner levels where the simulated gravity is very low, while humans may live in some of the outer levels where the similated gravity is much higher, similar to that of Earth. The humans would travel up to the ant levels to work at tending their domestic ants and using them for whatever purpose they use them for.
Part Three: How Much Oxygen is Neeeded?
The question says:
if there were giant ants (their gigantism is due to high O2 levels)
And I have explained that high O2 levels might possibly be necessary for giant ants but they are not sufficient for giant ants, because a low surface gravity or similated gravity would also be necessary for giant ants.
Arthropleura (Greek for jointed ribs) is a genus of extinct millipede arthropods that lived in what is now North America and Europe around 345 to 290 million years ago,1 from the Viséan stage of the lower Carboniferous Period to the Sakmarian stage of the lower Permian Period.1 The species of the genus are the largest known land invertebrates of all time, and would have had few, if any, predators.
A. armata grew to be 2.5 metres (8 ft 2 in) long.4 Tracks from Arthropleura up to 50 centimetres (20 in) wide have been found at Joggins, Nova Scotia.5 In 2021 a fossil was reported, probably a shed exoskeleton (exuviae) of an Arthropleura with width of 55 centimetres (22 in) and an estimated length of 1.9 metres (6 ft 3 in) to 2.63 metres (8 ft 8 in).2 Arthropleura was able to grow larger than modern arthropods, partly because of the greater partial pressure of oxygen in Earth's atmosphere at that time and partly because of the lack of large terrestrial vertebrate predators.
So higher levels of oxygen in the atmosphere did help land arthropods grow quite large. The reason for that is that they had many tunnels in their bodies open to the air to let oxygen freely enter their bodies, and the higher oxgen levels enabled sufficient oxygen to reach deep enough into their bodies.
With the lower oxygen levels in today's atmosphere, the inner parts of their bodies could not get enough oxygen to live.
So you might want to increase the oxygen levels in the atmosphere of your fictional world to what they were in the era of giant land arthopods so your giant ants can be as giant as you want.
But the body plans of all known ants seem to be very much different from those of Arthropleura. Arthropleura were shaped sort of like hallway rugs, with bodies several times as long as they were wide, and several times as wide as they were high. Being thin in one of their dimensions vastly reduced the the distance that atmospheric oxygen had to diffuse to keep their innermost parts oxygenated.
In contrast, giant ants with the mass of Arthropleura armata hae much more rounded cross sections. Thus many parts of their bodies would be too deep inside to be oxygenate even if the atmospehre was as oxgen rich as when Arthropleura armata lived.
So some writers might think that it would be a good idea to keep on increasing the oxygen in the atmosphere of the imaginary setting until there is enough to penetrate even to the innermost parts of the giant ants.
Part Four: The Boy Who Cried Dihydrogen Monoxide
In 1997 a 14 year old student brought the greatest amount of publicity to the chemical named Dihydorgen monoxide, pointing out many examples, as others did before him, of harm caused by it. And it is true that Dihydrogen monoxide has often been deadly to humans.
Since "di" means 2, and "mono" means 1, it should be easy to figure out that a molecule of Dihydrogen monoxide contains 2 hydrogen atoms and 1 oxygen atom. Thus its chemical formula is H2O - making it water, which is deadly in some cirumstances but also absolutely necessary for life.
In medicine, biology, and chemestry there is a saying that "the dose makes the poison". Nothing is poisonous if in small enough quantities, and everything is poisonous in large enough quantities.
"Everything" includes oxygen. Too little oxygen in the atmosphere means that humans and most other lifeforms die. Too much oxygen in the atmosphere means that humans and most other lifeforms die.
There is a section on the atmospheric requirements of humans in Habitable Planets for Man, stephen H. Dole, 1964.
Dole discusses atmosphere in pages 13 to 19. He says that humans need an inspired partial pressure of oxygen of about 60 to about 400 millliemters of mercury, as compared to the sea level oxygen pressue of 160 millimeters of mercury. So the maximum tolerable pressure of oxygen is about 2.5 times the pressure of oxygen at sea level in Earth's atmosphere at the present.
The present oxygen partial pressure of 160 milligrarams of mercury corrisponds to 21 per cent of the volume of the atmosphere.
Since the beginning of the Cambrian period 540 million years ago, atmospheric O
2 levels have fluctuated between 15% and 30% by volume. Towards the end of the Carboniferous period (about 300 million years ago) atmospheric O
2 levels reached a maximum of 35% by volume, which may have contributed to the large size of insects and amphibians at this time.
So when oxygen was 35 percent by volume, it would have had a pressure of about 266.66 mililmeters of Merury. If that was when Arthropleura armata flourished, inceasing the oxygenpressure could create somewhat creatures with its body plan, until oxygen pressure became about 1.5 times as great, at about the human limit.
Increasing the oxygen pressure beyond 400 millimeters of mercury to make the giant ants more giant would make the atmosphere unbreathable for humans, making it impossible for humans to interact with and domesticate the giant ants.
So perhaps you need someone more knowledgeable about such matters to calculate whether giant ants of the size you envision can interact with humans in the same atmospheric pressure and the same gravity, or whether they have to segregated by atmospheric pressure and/or gravity.
If the later is the case, then possibly your story would require the humans live in high gravity low pressure regions near the outside of a rotating space habitat and travel "upwards" and cross through airlocks and wear breathing apparatus while in the high pressure and low gravity inner regions where their domesticated giant ants live.