It may or may not be alright, depending on the details and application.
I have seen it done such that the nut was not firmly in contact with whatever it was welded to. The welds failed, preload was instantly lost, and the joint failed.
I've seen it done with smaller nuts on thin sheet - resulting in deformation of the sheet. This essentially built a spring into to the joint since the preload did not fully squish the deformed sheet.