1. Lock the door.

2. Lock the door, will you?
3. Will you lock the door?
4. Would you lock the door?
5. Would you lock the door, please?
6. Would like to lock to the door, please?
----------------------------------
Are they all grammatical? Is #2 a polite one? Or can we use #2 between friends? What about other things? Are the rest polite ones?

All are grammatically correct, yes. Adding "please" to #s 1-4 will make all of them polite!

All of the given sentences are grammatically correct. The politeness level varies between the different sentences.

1. "Lock the door." - This sentence is a direct command, and it is neutral in terms of politeness. It is a straightforward instruction to someone to lock the door without any additional politeness.

2. "Lock the door, will you?" - This sentence is a slightly more polite way of giving a command. By adding "will you?" at the end, it makes the command sound more like a request. It is commonly used in casual conversations between friends or acquaintances.

3. "Will you lock the door?" - This sentence is a polite interrogative sentence. It seeks information or a personal favor in a polite manner. It is considered polite and appropriate in most situations, such as asking someone to lock the door.

4. "Would you lock the door?" - This sentence uses the conditional form of "will." It is a polite way of making a request. It expresses a sense of politeness and is suitable for situations where you want to be courteous while asking someone to lock the door.

5. "Would you lock the door, please?" - This sentence is similar to the previous one but includes the polite word "please." By adding "please" at the end, it further enhances the politeness and respectfulness of the request. It is a common way to ask someone politely to lock the door.

6. "Would like to lock to the door, please?" - This sentence appears to have a grammatical error. It should be "Would you like to lock the door, please?" This sentence asks someone if they would like to lock the door. It's a polite way of inviting or offering them the opportunity to lock the door.

In summary, sentences 2, 3, 4, 5, and the corrected version of 6 can be considered polite. Sentence 2 can be used between friends, while the rest can be used in various social contexts to show politeness and respect.