Can onboard AC plug pins/socket damage the whole PCB if there's a short circuit?
The problem is twofold:

short-circuit: you must size your traces so that they can withstand the short-circuit current for a significant time (usually 1 sec.) and let the circuit breaker somewhere upstream trip; besides some good calculation of dissipation as for earth conductors (standards BS 7430, IEEE Std. 80, IEC 60364-5-54 , whichever you like), there is std. IPC 2221 specific for PCB traces;
insulation: you must comply with clearance (trace-trace separation) to withstand the mains voltage up to its maximum and any surge/overvoltage that is likely to appear; for this there are standards such as the old IEC 60950-1; I suggest to pay attention to values in case of conformal coating (advisable).

One last point for withstanding voltage capability: what you connect to mains must be able to withstand it, really, not nearly. So something more (wisely) is better than something less.
E.g. if you put resistors, think of their voltage rating at the maximum temperature and put some more in series, so that i) if one dies, the remaining ones are still able to withstand the worst case (&quot;N-1&quot; rule), ii) the overall withstanding capability is e.g. 50% more than needed.
If you are designing a product, then you must comply with electrical safety standards, because in that way you show your good design and good will in case of accident. A good one is IEC 61010-1 for instrumentation to connect to mains, and there you see the categories of expected overvoltages, because when you design clearance and rating of components, you design also for overvoltages. You have clearance (in air) between conductive parts that may go live to different voltages, you have creepage distance along PCBs and insulating surfaces, etc.