Arduino DDS Sinewave Generator

Can i generate a 40kHz senoidal signal?.

Do you mean "sinusoidal"?
With that software, no - you'd need to boost the clock to at least 80kHz, and I'm not sure the ISR would run at that frequency.

Do you really need a 40kHz sine wave?