They sure can't verbally, but in my opinion if you truly love animals and get or got to learn how they act and react, you can very easily determine if they're up for it or not
By experience, as an exemple, the first time I tried to get my (may herest in peace and I hope he's happy boy wherever he is now... life's a bitch) old boy, he wasn't interested and even disliked the fact of being touched. I always respected it and never tried after two unsuccessful attempts
Yet, one stray I met got very lovey after ten minutes of casual petting, despite being a complete stranger, he was the one pressing his sheath on my hand when I was scratching his belly
So I'm pretty sure they can consent in their own way, even ask for it when they want/need it