First you should be sure that you're actually invited. Meaning, your BF's invitation has allowed for him to bring a guest, if he is his invite will say "and guest" or "plus/+ one". If it has only his name on it and no mention of a guest for him, then he should not take you because you're not invited (nor is anyone else but him on his invitation). I extended a +1 to all of my single guests, but not everyone does.
Etiquette aside, attending a wedding as a guest of a guest is common. I attend weddings with my husband where I don't know the couple, but he does and he attends weddings with me where he doesn't know the couple quite frequently. We both have large extended families where we maybe haven't met them for some reason, plus he has all sorts of friends from college, med school, etc., I have friends he hasn't met, co-workers, etc.
At some point after the ceremony or during the reception... we introduce each other to the couple if we don't already know them.