Sacraments (including the sacraments of the Holy Order), conducted by heretic/schismatic clergy, are conducted validly, however illicitly. It is a sin for these clergy to conduct such illicit sacraments, and if recieving with knowledge of that the sacrament is conducted illicitly by a heretic/schismatic clergy, the reciever commits the same sin.
In the case of episcopical ordination, any episcopical ordination without papal mandate results in automatic excommunication for both to conductor and the reciever (Can. 1382 A bishop who consecrates some one a bishop without a pontifical mandate and the person who receives the consecration from him incur a latae sententiae excommunication reserved to the Apostolic See.). However, this is in the case if either the conductor and/or the reciever is Catholic, the Code of Canon Laws does not apply to non-Catholics. (Some time last year, if I recalled correctly) The Holy See issued a document on the correct use of Can.1382, this sould be easily found using Google.