Not sure about legality but here in the UK you will find opticians will give you your prescription, but often exclude the pupil distance measurement (I think) which a lot of the online stores require.
I think you can ask for it, but they will only give it begrudgingly.
I think you can ask for it, but they will only give it begrudgingly.