Someone is knocking on/at the door.

Inside, we say, 'Who is it?' Can't we use, 'Who are you?' Is it rude to say, 'Who are you?
(Can we use both prepositions, on and at here? Are both have the same meaning? what about the next question?)

It is the same of meaning, but it is to rude to say who are you.

Mamoth is almost right.

You'd ask "Who are you?" if you really don't want to let the other person in because you don't recognize him/her.

When someone is knocking on or at the door, it is common to respond by saying "Who is it?" This question is used to inquire about the person's identity.

Using "Who are you?" is also acceptable, but it may come across as a bit direct or less polite, depending on the context and tone of voice. It is important to consider the overall tone and intent behind your words when dealing with unfamiliar visitors. If you are concerned about being rude, it is generally better to stick with "Who is it?"

As for the use of prepositions, both "knocking on the door" and "knocking at the door" are grammatically correct and have similar meanings. The choice between "on" and "at" can vary depending on regional or individual preferences. In this context, however, both options convey the idea of someone knocking on the entrance of your home.

In summary, when someone is knocking on the door, it is customary to respond by saying "Who is it?" This is a polite way to inquire about the identity of the person. Using "Who are you?" may be seen as less polite, so it is generally recommended to use "Who is it?" instead. Both "knocking on the door" and "knocking at the door" are correct and convey the same meaning, so you can use either preposition.