Some people are claiming somebody could have dived to it. I don't know if that is the case, but I would assume Ukraine would be capable of sending a couple people who know how to dive a few countries over. They also likely have plenty of explosives.
There is quite a bit of risk involved in a covert operation like this for Ukraine. Let's just imagine they sent a special ops team covertly into Denmark (onto the island of Bornholm which is mostly reached by airplane or ferry) and planted some explosives on the pipeline in a secret dive operation.
There are quite a bit of scenarios in which this could go terribly wrong or be successfully attributed after the facts.
The paramount Ukrainian reliance on western support to have any chance to win this war makes me think that the risk/reward ratio for this operation would make it super unlikely that Ukraine would consider doing this.
Because Ukraine has no submarines and they don't have access to the Baltic Sea even if they had any?