Can I connect two devices that communicate using TCP or UDP?
Possibly, firstly if they both support TCP or UDP, they are using the same protocols, but this is not conclusive. The data contents of the messages can be vendor or device specific. What you need to determine is if they can understand each other (i.e. they each now what the data in the messages means). You should discuss with the companies providing the devices.