Incorrect thinking on many levels
First, defense industry is like the insurance industry. The money flow through it makes the GNP look bigger, but in terms of benefiting the People, it is useless. The most useful thing it can hope for is that a contingency happens, and it helps reduce the losses or pain.
So the question is not whether it is PROFITABLE (any profits are illusory once you count in the opportunity cost), but how to cut your losses while getting the capability your national policy and circumstances say it needs.
So sure, if the cost-effectiveness is same or similar b/w domestic and foreign produce, then sure, build local. In that case, the recovered amount by taxes tilts the table towards domestic products. However, where the foreign product is MASSIVELY cheaper, the amount the taxes recuperate no longer cover for the difference.
As for exports, when your product is massively more expensive, not as commonplace, and not as versatile as its competition for dubious gains in certain performances (Type 45 vs Aegis), I won't be looking forward to any recuperative sales there.
Finally, do remember that the Defence budget is the defence budget. The vitality of industry is the responsibility of another department. When the most defense-efficient solution is a foreign product, and the nation insists they buy homebuilt, they DO NOT allocate extra money (from the supposed recuperation via taxes and exports) to cover the shortfall. Defence just gets less capable. to the potential cost of its foreign policy and the lives of the front-line trooper.