To ask someone if they can or cannot do something, we start with a verb. For this example, we will use "nihongo wo hanasu" -- to speak Japanese. For this sentence structure, we will always leave the verb in its dictionary form (hanasu), no matter the conjugation. This makes this particular grammar point quite easy, as all conjugation is done with "dekimasu." To ask someone if they can do something, in our example "speak Japanese", we simply add the verb before "koto ga dekimasu," as shown below:
Nihongo wo hanasu koto ga dekimasu ka?
The particle "ka" is added at the end to indicate that it is a question. Literally translated, this sentence comes out as "Speaking Japanese, can it be done [by you]?" -- as with many Japanese questions, the "you" is simply understood and not spoken. As strange as this pattern may seem, it is a very common one in Japanese. A more natural translation gives us "Can you speak Japanese?" Here is another example:
Kono kanji wo yomu koto ga dekimasu ka?
The first part, "kono kanji wo yomu," is translated as "read this kanji", so the whole sentence would translately naturally as "Can you read this kanji?"