You will be denied boarding in the USA. There is almost zero chance you will be allowed to travel to country A.
Airlines are legally responsibility for checking your eligibility to enter your destination country, as well as your eligibility for transiting any intermediate countries. This includes both things like visa requirements, but also COVID-based rules/restrictions/testing requirements/etc. They generally will do this at check-in, and/or at the gate when you are boarding your first international leg.
In this case, your destination is country B, with a transit in country A. As you are legally not eligible to entry country B, your entire trip will be treated as invalid, and you will be denied boarding at your origin.
Using hidden city ticketing as this is called can be fraught with risk at the best of times. Using it across 3 different countries in the times of COVID-19 is almost certainly a bad idea.
This is known as "hidden-city ticketing." Airlines aren’t fond of it, and in some cases can take action by going after the frequent flyer accounts of people who do it or even suing passengers, especially if you do this frequently, as it violates the airline’s contract of carriage, though it can be done in some cases.
There are a lot of limitations though. Checked bags which are checked through to "B" are an obvious problem, as is round-trip travel as you’ve already observed (the airline will automatically cancel the rest of your itinerary if you no-show the segment from "A" to "B," so this doesn’t work for round-trips). There’s also the risk that due to schedule changes, flight delays, or cancellations, the airline rebooks you on another routing to "B" that never takes you to "A" at all. All of this is to say that hidden city ticketing is certainly a thing, but it can go wrong in a bunch of different ways and probably shouldn’t be attempted unless you’re really sure you know what you’re doing.
But the biggest issue here is that you say that you are not allowed into country "B" due to COVID restrictions. You haven’t said what countries these are, but it’s at least quite likely that the airline will confirm your eligibility to enter country "B" when you check in for your flight in the US: the airline won’t even fly you from the US to "A" until they’ve confirmed that you have the necessary documents (both immigration and COVID-related) to enter "B." Based on what you’ve said, you’re likely to be denied boarding.
Credit:stackoverflow.com‘