to cook

  1. Do you know how to cook?
  2. Do you know to cook?
  3. Do you know cooking?
    Are these sentences grammatically correct?
    If you find wrong, please give the grammatical reasons.
    Thanks.

#1 is OK.

#2 is wrong. You can’t say "know to ".*

#3 is grammatically correct, but an unusual thing to say. You would not say this when you meant #1.

*[Edited] Sorry, this not strictly true. Although it can’t be used to mean “Do you know how to cook?”, “Do you know to cook?” could theoretically be used to ask if someone knows that they ought to cook (in some particular situation). A more likely use of this colloquial form of "know to " might be something like “Do you know to ask if you have a problem?” (= “Do you know that you should ask if you have a problem?”).

“Does he know to come here first?” is from Oxford - dictionary.
Your logic "know to " is found violated.
Any more explanation for me to understand you?

You may not yet have seen my later edit to my post above. When I first read your question, I naturally assumed that you intended “Do you know to cook?” to mean “Do you know how to cook?”. This is not possible. Later, I realised that “Do you know to cook?” could (unusually) be used in a different sense, per my explanation above.

This different sense is what your Oxford dictionary example is illustrating. “Does he know to come here first?” means “Does he know that he should come here first?”. It does not mean “Does he know how to come here first?”

Dozy,
“Does he know to come here first?” does not mean “Does he know how to come here first?”
I understand it and appreciate you.
But the difference in meaning between “Do you know how to cook?” and “Do you to cook?” is not clear to me.
Please explain the difference in meaning between the following set of statements.
1a. He knows how to cook.
1b. He knows to cook.
2a. He knows how to swim.
2b. He knows to swim.
Thanks.

He knows how to cook - he knows the procedures for cooking something.
He knows to cook - he knows that he is expected to or has to cook at the specified point.
he knows how to swim - he knows how to move through the water, staying afloat.
He knows to swim - he knows that he is expected to or has to swim at a specified point.