Can is acceptable to use in informal contexts.
May would be better to use in formal situations.
For example,
Can I have an apple?” (The child is speaking to a peer.)
May I have an apple?
(The child is asking a superior if he will be allowed to receive an apple.)