Is it possible to mate while castling?

Yes, it is possible.
However, if you don't get the achievement, contact Support for them to manually unlock it for you.

Do you have to do it in a live game to get the achievement?
Yes. Not against the bots.
There was another game where I almost got checkmated by someone but castled and won
Do you know where that game is?
Has anyone checkmated by castling?