Not at all! Don't use it.
The only time that it's ok to use 'ain't' is :
* if you're quoting a song lyric or film dialogue etc where this word appears
* if you're writing a story about characters such as uneducated farm-workers and you want to make their speech sound authentic
* as a kind of joke
Otherwise, you should always use the correct standard form - doesn't, hasn't, didn't, won't and so on.