How do you handle random people stopping and talking to u?

Asking because this happens to me a lot when I'm out walking my dog.

People stop and talk to me mostly about her (my dog)

But I never no what to say lol Laughing 

My brain temporarily shuts down and I'm left feeling like I've just been hit in the face Face palm♀️ Eyes 

Usually I go "Yeah she's nice int she" and then pretend to call my mum and leave lol Rofl 

Same thing happens if I go in the shops for butter and milk for mum and dad. Cashier always talks which is polite I guess but it awkward for me.

Everything I answer is one word like "yes" but each answer lol LaughingLaughing 

I've never once looked at a random person and thought I'm gonna stop and talk to her lol Rofl