Can hashing become encrypting?
You can in principle encrypt using a hash function, in the manner you describe (although what you have described is not necessarily a secure construction).  What you are trying to do is generate a keystream from a hash function and a key.

You can use counter mode to turn any strong pseudorandom function (PRF) into a stream cipher.  CTR mode produces a keystream that is XORed onto the plaintext to produce the ciphertext (or vice versa).   Some Message Authentication Code (MAC) functions are PRFs; in particular HMAC has been proven (Bellare 2006) to be a PRF if the compression function of the underlying hash is a PRF (as is the case with SHA-2).  So HMAC-SHA256 in CTR mode would be a secure construction that supports encryption and decryption using a hash function.

While you can do this, you probably shouldn't.  The security of block ciphers for this purpose has received more attention, and block ciphers are substantially faster than hash functions.  NIST SP800-108 "Recommendation for Key Derivation Using Pseudorandom Functions" permits HMAC-SHA256 in CTR mode as a key derivation function, but cautions against using the output as a keystream for a stream cipher as "The level of security provided ... has not been investigated".

See also Is SHA-256 secure as a CTR block cipher?.