Pain is a feedback sensor which indicates that something's gone wrong. You could build a machine with pressure sensitive grippers. You could even place a threshold on that, above which the machine reacted by moving in the opposite direction. Biological pain is just a complicated version of that. Pain is just our minds interpretation of damage signals.
At what point do you draw the line. "This machine doesn't feel pain, it just responds to damage signals." could apply to a simple robot or a cockroach. At some point, biological computers become complicated enough that we deem pain to have arrived, but that point is fairly arbitrary. Why aren't we just biological machines?
There's a huge difference between feeling pain and reacting to demage. Humans can react to injury in a very complex ways without feeling pain. And buildings too - when you crash with an airplane into a building, the building reacts in a complex way. Does it feel pain? Feeling pain is something fundamentally different than reacting to demage.
If feel only fits your narrow, human centric definition of it, then of course machines can't feel pain. There isn't much point in having a discussion if the discussion is about your understanding of a word though.
If you go by the broader definition of feel, which includes "to have a sensation of something", then I'd argue that the line is far more blurred.
If you accept that a rat is capable of feeling pain, then surely you must accept that a functionally identical machine with a neural network functionally the same as a rat's brain can also feel pain? There's no real fundamental physical reason stopping us constructing a computer which functions in the same way as a rat's brain does. Does the computer we constructed suddenly stop being a machine?
My understanding of "feel" is purely subjective. I think it's impossible to create an objective definition. That's the problem
"To have a senseation of something" isn't really helpful definition, because "have a sensation" is just another word for "feel". It's like saying that the definition of "to buy" is "to purchase".
Physics cannot, even in theory, explain my subjective experience of pain. Why do I feel pain, when my brain's atoms are in specific positions?
The answer to your problems are not something you can resolve so tritely. The answers here are the responses to unanswerable questions - the spaces that religions have retreated to, in order to survive against science. These questions have no such answer that can be suitably determined.
Do you reckon a machine could have a sensor that made it feel emotional pain when it thought about other machines feeling emotional pain, because they lost a machine that they were close to through an extreme level of physical pain?
If you had a processor communicating with other processors by some protocol (I2C, wifi, doesn't matter), you could build out a feedback loop where one processor's output becomes the other's input...and have one processor output audio when the other processor receives specific input...
Given that we are biological machines, I'd say I do. Saying "machines don't feel pain" suggests that pain is something more than a complex process happening in a biological machine. It's not.
At what point do you draw the line. "This machine doesn't feel pain, it just responds to damage signals." could apply to a simple robot or a cockroach. At some point, biological computers become complicated enough that we deem pain to have arrived, but that point is fairly arbitrary. Why aren't we just biological machines?