Preparation by pyrolysis of boron and nitrogen containing compounds