It is important to note the difference in a Hubitat "App" versus a Hubitat "Driver", as it will help to make sure we're all clear with exactly what is being asked.
An "App" can subscribe to 'events' that are generated by Devices (which use drivers), as well as platform events. Apps can also call commands that are implemented in device drivers.
Drivers cannot make calls into apps, except in the special case of a Parent App that has created Child devices. One can also create a Parent Device Driver, that creates child devices.
Rule Machine is a Hubitat provided "App". Apps cannot make calls into other applications. They can only make calls to a device's set of commands.
Hubitat uses the concept of a set of Standard Capabilities for its device drivers. By adding a capability to a driver, the developer is expected to implement that capability's list of Attributes and Commands. In doing so, an "App" can rest assured that if a device advertises itself as having a certain set of capabilities, that it can subscribe to the events generated whenever that device's standard Attributes are changed as well as know what commands that it can call on that device.
For example, if a driver implements the "Switch" capability, it is expected to provide the following attribute and pair of commands.
Perhaps the driver is not just for a simple on/off switch, but also is capable of providing dimming functionality. By adding the "SwitchLevel" capability, the driver will also need to implement the following additional attribute and command.
So, now we have a dimmable switch.
But what if we want to perform some special standard default configuration on this special, custom dimmable switch device each time the Hub starts up? We can simply implement the Initialize capability as well, and add the custom config code to the "initialize()" routine.
And so on, and so on.
The Telnet capability requires the driver to implement the following attribute and command.
Telnet also requires the developer to make certain calls to establish a connection (telnetConnect()), handle incoming data (parse()), and implement the telnetStatus() routine so the hub can let the driver know when the connection is dropped. This provides a mechanism for the developer to implement automatic reconnect logic.
https://docs2.hubitat.com/developer/interfaces/telnet-interface
Hopefully this helps a little in learning the platform architecture. Lots more information available in the Hubitat Developer Docs.