It depends. For a Will to be valid, there are certain requirements - one of them being that the testator must be of sound disposing mind.
If there is any question of capacity, a medical certificate should be obtained.
It can be quite difficult for a solicitor to establish mental capacity. From my personal knowledge of persons with dementia/alzheimers, capacity is not always immediately/obviously apparent. Some people can have capacity in "bursts". In general, most solicitors would be wary of taking instructions to prepare a Will, from an elderly person who is not personally known to them.
mf