My view on this is very similar to Lowspark's and Outdoor Girl's.
Maybe a good way to look at it is this: if only you are invited, then only you are invited, and you should not ask if you can bring someone else. BUT -- as with most rules, there are times when it's okay to violate it (I mean by asking, not by just showing up with someone else -- that's never okay).
And those times tend to be very casual situations with very close friends. So:
- For something like a wedding, or really anything with a formal invitation, even of a very close friend or relative, I would not ask if I could bring someone. (I have had a couple of my own cousins ask if they could bring someone, and I did say okay, and I didn't mind, but really I still think they shouldn't have done it. The only time I think it is okay is when the person you are asking to bring is someone to whom you are very likely to become engaged soon, and it's time to introduce them to the family. In that case, I think it's not only okay to ask, I think it's a good idea! It's practically an announcement, though, so I'd be doubly careful not to ask if it's just a date or even a boy/girlfriend.) An elderly or handicapped guest asking if a helper can come doesn't count.
- For something like an open house or party in the park, I would ask only if the hosts were good friends and I was fairly sure it would be no problem. But I wouldn't do it even then just so I'd have an escort rather than come alone. I'd do it if, say, it was an out of town guest or a person new to town that I thought should meet this crowd and vice-versa. I also have asked a friend who gives big parties if my daughter, who was visiting from out of town and with whom she has a relationship, could come too -- because I was sure that if she had known my daughter was in town, she would have invited her in the first place. And finally, there are times like Halloween, Fourth of July, and New Year when lots of people give open house style parties and it's sort of understood that guests will be kind of making the rounds of more than one -- ordinarily a no-no, but not so much on those days -- so if you are making the rounds with someone else, I think it's okay to ask if you can bring them, too.
- The really tricky part is something like a dinner party. In that case, if the host were a VERY close friend, I might, in the case of the new person in town who would fit in so well, mention that and ask if they would like to invite them, too. If I had out of town guests, what I would do (and have done) even with a close friend would be to say that we have a conflict because these guests are coming. Then it's up to the hosts to say either "Bring them!" or "Oh, too bad, another time, then," without being placed on the spot by being asked.
BUT: in all these situations, it isn't ever okay to ask if you can bring a guest of your own just so you, too, like people with families and spouses, get to bring someone. That implies that the other people at the party aren't interesting enough company for you or that the hosts' event is not worth your time unless you can make a date out of it. If you feel awkward arriving alone, ask who else is invited that you could call to ride with.