Can I use any USB charger with my iPhone? I'm not sure its the right place to ask but, I just wondered whether I can charge my iPhone Xr with my Samsung adapter. I understand it works and no harm is done to the iphone.

I know that the iPhone transmitting info about voltage and current between the phone and adapter so that the current and voltage wont exceed iPhone limits?
If I am understanding you correctly...

A power adapter with a USB port on it will charge anything that that can be charged via USB. So, probably...

That said it is important to note that some USB chargers don't provide enough wattage to charge a device or charge it quickly enough. Also if the usb charger has just a mini/micro USB cable on it then no, as iPhones have *Lightning" connectors not USB connectors.

There is also the issue with cheap, knock-off chargers that are constructed poorly and will damage anything that are plugged into them.

That said a USB charger that is designed to charge a Samsung phone should work as long as it has a standard USB port on it that you can plug a lightning cable into.