I think it was Porridge that introduced "naff off" as a harmless alternative to something much cruder. Whether there is any connection with "naff" in the sense of vulgar, or socially crass, I don't know.
"Naff off" was first seen in print in "Billy Liar" in 1959, along with "naffing". "Porridge" started in 1974. "Naff" might have started as back-slang for fan(ny) - UK usage, not US.