to detect Zero Crossing of ac mains, can i connect an EFM8 pin configured as input directly to 220V ac via a resistor?
Assuming the EFM8 input pins have clamping diodes, yes, using two 1Mohm resistors. One resistor connects the input to AC Line, and the other connects ground to AC Neutral. Note that there is no isolation and the entire MCU circuit should be considered to be at mains voltage.
See AVR182 for further details and considerations.