Well, it's definitely not ideal. If at all possible, you should ask someone out in person.
That said, I did recently ask someone out via Facebook message, and she said yes. I wasn't originally intending to, but I while I was chatting with her, I learned that I wouldn't get the chance to see her again for another week. So, I went ahead and asked right then (I also mentioned that I would have preferred to ask her in person).
I think that, in that sort of situation, it's acceptable. I answered "kind of" for that reason.
There are very few hard and fast rules for romantic relationships.