Yes you can but usually it’s chronic. Like what I got.
This is from google
Hemorrhoids generally last several days and often recur. Anal fissures often cause pain during and after a bowel movement, sometimes followed by throbbing pain for several hours. They are also often associated with itching and blood on toilet tissue, in the bowl, or on the surface of the stool.
So I would say no, yes it would be painful when you poop with pile and it will hurt more until it settles down. I find this is when a spritz bath is best, helps ease the pain. If it was me I would poo, have a bath then apply the cream. Unless I was super busy and didn’t have time it would be straight on with the cream or suppository. It’s when you need it the most after a poo.
I feel your pain, it’s so painful doing poo with piles or fissure. I haven’t had a pain free poo in a year.