Parvati, the wife of Shiva, once got confused and performed patha pooja (ablution of feet, considered an act of respect) to Brahma, instead of Shiva. Shiva got enraged and cut off one of Brahma's heads; the cut head got stuck in his hand due to Brahma's curse.
To get rid off the sin, Shiva worshipped Vishnu at Thirukarambanur as Bhikshatana, where a part of his sin was relieved.
https://8div.blogspot.com/search/label/Thirukarambanur
He got his curse fully relieved after visiting Vishnu at Thirukandiyur and taking a holy dip in the temple tank, Kamala Pushkarani. Since Vishnu relieved (vimochana) the sin (saabha) of Shiva (also called Hara), the temple is called Hara Sabha Vimochana temple. After the incident, the tank came to be known as Kapala Theertham (kapala indicates skull). Shiva was pleased and he built the Hara Sabha Vimochana temple and also built a temple for himself near it.
As per another legend, Lakshmi, the consort of Vishnu requested Shiva to cut off one of the heads of Brahma as she felt that Vishnu would ignore her and show all his affection towards Brahma. Sage Bhrigu, King Mahabali and Chandra (Moon) all got their sins relieved worshipping Vishnu here in the temple. Sage Bhrigu, once wanted to test the superior of Vishnu, Brahma and Shiva. He kicked Vishnu in his chest in anger and got relieved of the sin here. Chandra, who sinned by seducing the preceptor's wife, got partially relieved of it by worshipping Hara Saabha Vimochana Perumal.