To answer your _specific_ question, then yes, of course, you can encrypt a piece of data using another piece of data as key, even if both the data and the key happen to be identical. But what would that achieve ? _Decrypting_ would be difficult: you need the key to decrypt, and you do not have the password until you have decrypted it...

"Self-encryption" could be viewed as a kind of hash function: a deterministic transform of some input data, in a way which can be reversed. Hashing is the proper framework for password storage (where, in fact, the password is not stored, only a password verification token). However, growing home-made hash functions is known to be hard; when cryptographers want to build a hash function, they take [a lot of time][1] because they need to be sure that the function is secure, and you cannot know that just by looking at it.

Also, secure hashing is not, by itself, sufficient. You need a SLOW and SALTED hash. This subject has been beaten to death several times on this site, see for instance [this question][2] or [that one][3]. The comprehensive answer being: use  [bcrypt][4].