Yes Coffee Grounds can and do keep squirrels away.
Coffee Grounds put out a scent that the squirrels hate although the smell of coffee grounds are good to us the smell of coffee grounds are awful smelling to squirrels.
You can keep squirrels away from areas and plants by sprinkling some used coffee grounds around the plants or the area you want to keep squirrels away from.
The squirrels will smell the scent of the coffee grounds and will run off really quick once they get a whiff of the coffee grounds.
I use coffee grounds around outdoor plants and the squirrels stay away from them when I keep coffee grounds near them.
The coffee grounds also help the plants grow and thrive as well.