Shaykh Abdul-Muhsin Al-Albaani was asked:
Some people, when they invite you over, they leave the door open during the time you will come. So do you enter [straight away] or do you knock on the door?
“Knock on the door because the door might have been opened by a child and not for the one who is coming to enter. He should seek permission and not enter except after seeking permission.
However, if he comes with the messenger who was sent to invite him and he enters along with him, then this is his permission as indicated by the Hadith mentioned in its chapter”.
[Sharh Sunan Abi Dawood no. 590]
The Hadith the Shaikh is referring to is the following:
عَنْ أَبِي هُرَيْرَةَ، أَنَّ النَّبِيَّ صلى الله عليه وسلم قَالَ “ رَسُولُ الرَّجُلِ إِلَى الرَّجُلِ إِذْنُهُ
On the authority of Abu Hurayrah (may Allah be pleased with him) that the Prophet (ﷺ) said: A man’s messenger sent to another indicates his permission to enter
[Saheeh Sunan Abi Dawood no. 5189]
Faisal bin Abdul Qaadir bin Hassan