Is there an iperf command available in RouterOS? If not, is it possible for a end user to add it via a package, as one would with a generic Linux distro? I see that https://help.mikrotik.com/docs/display/ROS/Speed+Test tells how to run speed tests between two Mikrotik devices, but I am looking for a way to test speed between a Mikrotik device and a non-Mikrotik device (a Ubiquiti switch or router for example).
You can’t add anything 3rd party into RouterOS.
ROSv7 will (eventually) support running docker containers and that will allow to run 3rd party applications.