From a purely legal point of view, your employer is not allowed to ask you about your previous salary. In theory, the recruiter conducting a job interview is also not allowed to ask you directly about your previous or current salary.
However, there is an exception if the income allows conclusions to be drawn about the work performance, for example because the remuneration is customary in the industry on a commission basis.