They can waive torts, yes. Doing so is a very specific process.
Cops regularly get qualified immunity for absolutely egregious conduct. The military is not going to get successfully sued for shooting down a $12 balloon while acting in good faith on national security duties.