Pretty much, all visions are in the spiritual realm, meaning they are made of Investiture. Since Hoid has been through so much, he wasn’t only made of concentrated Investiture, which is supposed to copy people’s memories, he was also Cosmere-aware, which meant that the vision knew it was a vision. It was an overload of investiture that caused the vision Hoid to “glitch” and understand that he is a vision.