Neither herpes nor any other STD can cause symptoms earlier than 36 hours after exposre. Your anal symptoms could be any of several things from hemorrhoid, perianal abscess, and other things, but absolutely could not be an infection acquired just a few hours before it started. An abscess in particular can become quite severe if not promply diagnosed and treated. Do not sit on this problem (pun intended); see a health care provider right away.
Good luck-- HHH, MD