I see this sentence in Hartshorne, exercices 3.6 in chapter 1. And he build a counter-example, namely $\mathbb{A}^2 \backslash \{(0,0)\}.$ But for me, this sentence is absolutely trivial.
Indeed, an affine variety is closed and a quasi-affine variety is dense open. So if a variety is affine and quasi-affine, it is the whole space $\mathbb{A}^n .$ There is something that I'm probably missing here. Thanks for any helpful comment.