Can I obtain the hashing algorithm if I know both the input and the output? Suppose I have a string "Hello World".
And I pass it through an unknown function which gives output as "6Xbhkfo520/78".

So, using several input and output pairs, can I determine the algorithm of the hashing function?
It is weird to assume a hash function is private. This contradicts Kerckhoffs's principle. If you are talking about keyed hash functions, then I think the answer is no in theory. They are typically used to construct message authentication codes like HMAC, of which the keys cannot be derived from several hash inputs/outputs.