日本語できますか?
にほんご できますか?
nihongo dekimasuka?
Do you speak Japanese?
日本語が話せますか?
にほんごが はなせますか?
nihongoga hanasemasuka?
Can you speak Japanese?
When you want to ask a person whether she or he able to do something, you do not want the opponent feel bad when they can not do it. Instead of asking "can you?" ask “Do you?"
eg:
Instead of of asking Can you drive? you ask, do you drive?. Though literally you want to know whether they can drive or not, the second one is polite way to ask. Because it does not deal with the ability of the person.