Can I use a buck regulator for mains voltage if I put a resistor before it?
$$\color{red}{\boxed{\text{A non-isolated mains AC power supply is a dangerous device - be warned}}}$$
However, if you want some recommendations I'd seek out Power Integrations and consider using this type of buck arrangement: -

Adding a 10 ohm resistor in series with the input is not unheard of as a way of cutting down the inrush current and, if you don't care too much about efficiency it can be many tens of ohms. The one above is a fusible resistor so maybe that is the part you actually saw.
Here's where you can find details on the LinkSwitch-TN2 device.