Is the following correct?
Can I get some chocolate for myself? Yes, you can but not much.
Is two bars OK?
Is there any rule to explain the sentence above?
The dialogue's taken from Grammar Textbook Round-Up Level #3.
Is two bars okay?
Usually, that is acceptable. And often the singular verb might be preferred in the type of sentence like yours — but it can also depend on the context.
Notice that a declarative version could be "Two bars is okay". The subject "two bars" is a measure phrase, and so, usually, the speaker can use singular subject-verb agreement in this type of sentence. Often, the singular override is strongly preferred. (Sometimes, such as when the predicative complement is a singular noun phrase, the override is obligatory.)
Similar declarative clause examples could be:
- Three eggs is plenty.
- Five miles is rather more than I want to walk this afternoon.
Interrogative clauses that are somewhat similar to those above two could be:
- Is three eggs plenty?
- Is five miles more than what he wants to walk this afternoon?
For many sentences using a measure phrase as subject, the speaker has the choice between using singular or plural verb — though, often, the singular override is strongly preferred (though, again, context is a strong factor).
The "rule" may be called the measure override. For more info, there's the 2002 reference grammar by Huddleston and Pullum et al., The Cambridge Grammar of the English Language (CGEL), section "18.3 Further overrides and alternations", section 'a' — Measure phrases, page 504.