I mean, technically, you can. They will invite you, you can accept their invites, and you may then begin a long and difficult sequence of missions with a team of random internet weirdos. You just shouldn't.
I should know, I've been trying. Having started a new character on the PC version, and with most of my friends playing the game on console, I haven't been able to settle in and try the heists with anyone I can confirm is a breathing and functional human being.
So I figured, fuck it, I want to play these heists, so I'm going to play them with internet strangers, see how it goes.
Rockstar go out of their way to emphasise the difficulty and need for communication with these missions in the loading screens, and you spend enough time looking at them in GTA Online that I should have paid more heed.
My first mission was over almost as soon as it began. The host had a mic, and spent the entire transit time trying to plan a strategy. We arrive at our destination, a dude jumps off a motorbike, runs into a crowd of bad guys armed with only an uzi and is dead in about half a second. He respawns and does the same thing again. Game over.
Given the time lost in loading screens, matchmaking and driving to the heists, and with a vision of hours wasted with this idiot, I dropped out of this game and vowed to try another night.
My next attempt went a little better! We were supposed to hijack a plane at the airport. We got there OK, killed the guards OK, and despite an early casualty clearing out the hangar bay were on our way. Then one player got in and started taking off without the rest of us. I ran to get on the plane, and just as I got near, it lurched in my direction and ran over me, ending the heist.
I shouldn't have given it a third try, but I did, just to be fair. My third attempt involved me and another guy heading to the docks to steal a car off a freighter. Having both arrived in my car, which was both weird and kinda cute at the same time, I got out and started sneaking towards the entrance.
I don't know why I bothered. My fearless/brainless companion had run ahead and started firing a .50 cal pistol at every scalp he could see sticking out over the top of the ship, which triggered the alarm and had him killed twice in about two minutes. Heist over.
Maybe the problem here was communication. Not many people like to chat publicly in this game, and without the ability to coordinate tactics and movements properly, these operations that otherwise require intricate teamwork are instead being attempted by mute individuals, running around blindly and doing their own thing.
Or maybe the problem is just that GTA Online is full of idiots.
Whichever it is (and it might be a combination of the two!), don't be like me and ignore Rockstar's warnings. Heists are for friends, not strangers.