Twitter’s co-founder has publicly apologised for the role the social media platform might have played in the election of Donald Trump.