Beijing's top representative office in Hong Kong has warned the pro-democracy opposition's primary elections at the weekend could violate a new national security law, exacerbating concerns over a crackdown on the former British colony's democracy movement.