Yes it's perfectly fine and okay for a 2 year old to have a pacifier in the day and at night.
Although most people recommend taking the pacifier away from your child when they are 18 months to 1 year old or less it's okay if a 2 year old uses a pacifier.
My son is 5 and still uses a pacifier at home during the day and at night.
He suffers from anxiety and has slight autism so the pacifier helps relax him and I never took it away and his doctor said it was fine.
If I try to take the pacifier away he has a huge fit.
He's embarrassed to use the pacifier in public but at home he uses the pacifier and it calms him and soothes him.
They make adult sized pacifiers and I admit that I have an adult sized pacifier myself and it soothes me and relaxes me.
Pacifiers should not just be for babies, toddlers etc.
Anyone that wants to use a pacifier should use one at any age.
Although in public an adult or older kid should not use a pacifier as they will get made fun of.
But at home in private a pacifier is perfectly acceptable at any age.