In my experience, brain fog, anxiety, and depression are not necessarily linked. However, if the brain fog is linked to physical pain in the brain and body, I believe the pain could be linked to irritability, anxiety, and depression, just as any chronic pain can be. For me, the phenomena of brain fog is that whatever is causing it is shutting down certain parts of the brain. In many cases, this may be the cognitive part, but for me, brain fog can also impair my ability to emotionally connect - both with my own emotions, and with other people.
EDIT: I agree with rebar below that irritability, anxiety and depression can sometimes coexist with cognitive brain fog if these biochemical switches are thrown too. Just another part of the brain being messed with. In my experience, though, it was more often the gut brain, when it was experiencing difficulties, that liked to throw the emotional switches.
I don't suffer much from severe cognitive brain fog anymore, but as I was getting better, I noticed I went through a period of experiencing a lot of "mystical brain fog," where I would spend a lot of time in semi-meditative states, not worrying about much, just content to be who, where, and how I was at the moment. It was actually pretty enjoyable. I think that during this period, the factor that causes brain fog was still affecting the brain, but this time was shutting down the "monkey mind" part that thinks and worries a lot about things. When experiencing the milder, mystical brain fog, I did not experience the extreme brain/body discomfort that I felt with more severe brain fog.