Yes, both Argentina and Brazil could produce nuclear weapons, given enough time and effort, but neither one of them has ever had them. Neither does either country currently have plans to produce or acquire nuclear weapons, as far as is publicly known. So they are not examples of countries that gave up nuclear weapons.
A nuclear submarine is also not what is meant by "nuclear weapon", although it is arguably a weapon and has the word "nuclear" in its name. The phrase "nuclear weapon" conventionally refers to "atomic bombs" and "hydrogen bombs", which are bombs powered by respectively fission and fusion. A nuclear submarine is just a regular submarine powered by a nuclear reactor. Brazil already has many nuclear reactors that are in some sense "totally based on Brazilian technology" and has for decades.
> Brazil already has many nuclear reactors that are in some sense "totally based on Brazilian technology" and has for decades.
I only knew of the three commercial reactors, the third of them under construction for something like four decades and still far from done (and they are also mostly foreign technology AFAIK). So I went looking, and it does seem there are a couple of decades-old research reactors I didn't know about: https://pt.wikipedia.org/wiki/Lista_de_reatores_nucleares_Br...
Ten, in fact. Most places have a lot more research and medical reactors than power reactors in nuclear power stations, because you can build one of those for something like 1% of the cost of a nuclear power station. (Remember that the first research reactor, Chicago Pile-1, was built under the stands in a football field, by a team of about 30 people, between November and December of 01942, without any engineering data from existing reactors, on a budget of under 3 million dollars—US$51 million in today's money: https://data.bls.gov/cgi-bin/cpicalc.pl?cost1=2700&year1=194....)
I went to a state university in the US that had its own research reactor, and I thought their university hospital had another one, but it turns out they don't now if they ever did.
A nuclear submarine is also not what is meant by "nuclear weapon", although it is arguably a weapon and has the word "nuclear" in its name. The phrase "nuclear weapon" conventionally refers to "atomic bombs" and "hydrogen bombs", which are bombs powered by respectively fission and fusion. A nuclear submarine is just a regular submarine powered by a nuclear reactor. Brazil already has many nuclear reactors that are in some sense "totally based on Brazilian technology" and has for decades.