is a protocol a pack of algorithms and programming source codes? (in both the computer and network)
No. A protocol is an abstract description of how systems communicate. Source code could be an implementation of a protocol, but the protocol is not the same as its implementation. Basically, a protocol tells a programmer "the messages should be formatted like this and you should respond in this way to this message", but it is up to the programmer to decide how to implement this in an algorithm and/or source code.
regarding the previous question, if so, that means the operating systems/network nodes/applications/hardware indeed have such packs of codes inside their body to perform communications to each other that follows the same protocols? (such as TCP/IP, smb, secure shell, SMTP...)
Yes, operating systems and other hardware do contain code (or sometimes specialized hardware) that implements protocols. However, the way a protocol is implemented may (will) be different between different operating systems and pieces of hardware. The protocol sets standards for how the system should behave to the outside world, but not for how this is implemented internally.