I'm quite brazen on this front. If someone has come to a dance, has paid to get in to a dance and is standing/sitting next to the dance floor I consider they're fair game for an offer of a dance. Maybe I'm insensitive but I never consider asking the person they're with if they mind. IMHO it's up to the person you've asked if they want to dance with you. The person you've asked might consider asking the person they're with if they mind - I've had this happen a few times and, thankfully, they've always responded positively.
So, if you ever see me chatting at the side of the dance floor feel free to ask me for a dance - you could ask whoever I'm talking to, but I'd prefer it if you asked me
