leads to formation of hemorrhoid
which are enlargement of rectal veins, which can present as nodes / mass near anus. Other causes can Fistula in ano, Anal Fissure
You need to get evaluated and get a rectal examination
which find out the cause. Once the cause is found treatment can be planned accordingly.