PIC16F877A has been designed to work with a maximum clock frequency of 20MHz. You shouldn't use anything above 20MHz as stable operation is not guaranteed. You may succeed in temporarily making the PIC work. But chances are it'll soon fail. So, 20MHz is the maximum you can use.