Can I base a public-key cryptosystem only on a hash algorithm? Could I base a public and private key system on just using a hashing algorithm? For example:
privKey = sha256( randomGenerator() ) 
pubKey = sha256( privKey )

Why do I need to use different algorithms? For example, RSA or ECC?
There is actually a system for hash based signatures being standardized, see here.
Hou have described a system where the public key is derived from the private key in such a way that the private key cannot be recovered from the public key. However, it is unclear what operations you can perform with the public key that can only be reversed by persons having the private key. Without such operations the derived public key is useless.
Public keys and private keys do need to have a mathematical relation so that they can be used for encryption / decryption, key agreement or signature generation / verification. Such schemes are based on a specific mathematical problem such as the discrete logarithm problem (DLP) or the RSA problem - factorization of a number that is a product of two or more prime numbers.