When does 'okay' work as an answer to a question to replace yes?
For example, asking a question like: "Do you want to go to the shop with me?" can be answered with "Yes", but can it be answered with "Okay"?
A similar example that I think doesn't work is: "Do you like ice cream?", which wouldn't seem to work with "Okay", but would with "Yes".
Where is it and isn't it proper English to answer a question with "Okay" in the place of "Yes"?
Okay is the informal (and somewhat trivial) version of yes, so it is appropriate to use it when agreeing to something, for example, "Would you like to go to the mall?" But when being used as an answer for something that either requires more description or a definitive answer, like "Was there ice cream at the party?" is not acceptable.
I think the OED's definition of Okay clarifies this nicely. It says "Expressing assent, concession, or approval, esp. with regard to a previous statement or question: yes, all right." So it is only in the sense of expressing approval that okay and yes mean the same thing. Other meanings of yes are not included.