When I travel together with someone (whether my mum or a friend), it's always been natural for us to approach together, including in the UK, France (including Guadeloupe and Martinique), Germany, Switzerland, Sweden, Bosnia, Macedonia, Turkey, North Cyprus and Georgia (in fact I will often hold both of our documents). So far no one has ever given us grief for that.
However, anecdotal evidence suggests officers may not allow it if you aren't family, but unless you're in an ultra-sensitive country like the US, where you risk getting sent back over the slightest error, the worst thing that can happen is they ask one person to back off while the other one is processed.
If you absolutely don't want that to happen, stay together in the queue, try talking to each other so the officers realise you're together, but let one approach the officer first, and if asked about the other person, point to the other person.
the Immigration and Customs officers, would they be able to know if we booked our tickets together or is that information not available to them?
In some advanced countries like the US, they may know once they scan your documents, because of advance passenger information. In general, though, no.