In standard set theory (ZFCZF) this kind of set is forbidden because of the axiom of foundation.
There are alternative axiomatisations of set theory, some of which do not have an equivalent of the axiom of foundation. This is called non-well-founded set theory. See e.g. Aczel's anti-foundation_axiom, where there is a unique set such that $x = \{x\}$.