Ukraine did not have the capabilities but could be provided with them by USA for example.
You need a specialized boat to do so, if possible with a submarine. Like the SS-750 which was there a few days before the explosion.
https://en.wikipedia.org/wiki/2022_Nord_Stream_pipeline_sabo...