This is called the "infant industry" argument, and it has been made since at least the 16th Century, most famously by Antonio Serra, a proto-mercantilist.
This idea of raising tarrifs on imports and then using the money to protect domestic industries has been tried in Latin America in the 60s and 70s, in Africa, and in many places.
The results are mixed.
The problem with infant industry is that you get a group of local monopolies protected by the government who sell expensive low quality goods to the public, people get sick of it, they want the lower priced better foreign goods as it will increase their quality of life, and at some point there is sufficient political pressure to force a regime change.
Another way of saying this is that the infant industries often fail to grow up, they remain protected infants forever.
On the other hand, if you don't protect your infant industries, then you have no chance against mature foreign competitors, as you point out.
Then there is a third aspect to this, which is that foreign governments, especially East Asian governments (not only China, but China is the biggest offender) massively subsidize domestic industries and so you have to subsidize and protect your industries in return, or they will be destroyed by competitors who never need to turn a profit, or repay a loan, or meet any environmental regulations, or deal with unions, etc.
So it's a tough call. All these theories have valid points, but they all have fatal flaws. For the last few years, I've come around to the following mantra, which is my own development philosophy:
* every country should have a long run balance of payments. That means all trade should be balanced.
* countries should make investments in local productive capacity, but not subsidize industries per se
* countries should not allow foreign companies to set up factories or purchase capital or land. Each nation's assets should be owned by their own citizens only.
* With the above caveats, there should be free trade and no industry protection.
What this means, in practice, is banning foreign capital inflows. Have your own currency, borrow only in your own currency from your own people, and don't allow foreigners to purchase your bonds, stocks, land, private debt, or productive capital.
But trade all you want with them. As long as you do that, your currency will depreciate sufficiently to prevent any flood of cheap imports, and your domestic industries will have a chance.