Both questions are correct but the meaning is technically slightly different.
"Can you whistle" is asking whether you are able to whistle.
"Could you whistle" is asking whether you would be willing to whistle.
In practice, both are often used interchangeably.