When launching a nuke, you are generally targeting a specific unit AND the province that the unit is standing on. You will definitely end up at war with the owner of that province.
Units of other countries, even your own or allied units, that are within 50 km of the blast point of the nuke will be damaged or destroyed. This collateral damage does NOT initiate a war, so you should be fine with this approach. Of course there is always the possibility that the AI will declare war on you anyway based on your reputation.