Thank you for your query.
I think you son has worms.
Perianal itching along with anal pain
with the history of a pet nearby indicates a worm infestation.
Deworm him and apply lactocalamine lotion to the local area thrice daily.
Consult your doctor if the problem persists.
If you have any further queries you are free to consult me.
Hope this answers your query.
Wishing a speedy recovery.
Have a nice day.