Yes. I heard of pieces of art with passive antennae in it, and a pair of earphones is just a small computer so that could easily do anything a computer can: run exploits against your Bluetooth/WiFi controller or software, attack WiFi networks in the neighbourhood, indeed grab your contacts or try to initiate file transfers with malware, record with a hidden microphone and send audio via mobile data, GPS tracking... heck, it could record and transmit some low bandwidth data via some Bluetooth side-channel. Theoretically.
Practically, I never heard of such a thing. Which would be exactly why the secret services might do it: nobody suspects anything. But that doesn't mean it's likely. Things like mobile data connections would be measurable and the chips, if you know what to look for, probably identifiable. Attacking WiFi/Bluetooth is definitely visible in packet captures. GPS tracking also requires a data connection such that the attacker can actually receive the data (live, at least; recording is always an option).
Unless you have reason to suspect otherwise, this is probably not a pair of trojan headphones.