From history it seems that you might be having round worm or tap worm.
While taking bath it might have come out.
due to passing worms
you get itching in anal region.
Go for one course of anti-worm treatment like Albendazole
Keep your nails clean and well cut.
Ok and take care.