Is connecting a generator to the line input of an audio amplifier OK?
The data sheet states that the input line is 400mV-2V.

That is probably OK; I'd assume you can easily set your output to that amplitude range.

Also I know that the generator is 50Ohms. Do I have to care about that ?

Not in this case: the input impedance of an audio amplifier will be very high, so that the source doesn't have to drive much load (i.e. be able to supply much curent).
And, at 20 kHz you don't have to care about wave impedances etc: your cable is much, much smaller than the wavelength of a 20 kHz electromagnetic wave.
So, this will work.

Note that your generator is absolutely overkill.
A sound card would do just as well – these are audio frequencies, after all!
Also, everything but the worst sound cards have astonishingly high fidelity, so that's often an attractive choice. You'll want to be a little careful when using a sound card that it has (or you add) good anti-imaging filtering (i.e. to suppress harmonics that arise from the discrete-time sampling).