Solace Pub Sub vs AWS Active MQ

can we migrate Apache MQ/Rabbit MQ which are on prem to Solace?
Yes, it should be possible. However, the devil is mostly in the details with these type of questions.
For Apache MQ, your applications would be probably using AMQP 1.0, which is supported by Solace as well. Porting those should be relative straightforward.
For Rabbit MQ, this will mostly depend on what protocol your applications are coded against. If they make use of AMQP 1.0 or MQTT (available via plugin), then again that should be relatively straightforward as Solace supports both these protocols. But most Rabbit MQ applications use AMQP 0-9-2 which never made it into a standard and is pretty much only supported by Rabbit MQ. Those applications would need a bit more adjustments to work with Solace.
Depending on the exchange type they use (which again is a Rabbit MQ specific concept), this can be relatively straightforward (e.g. Topic Exchange) or may need a bit more redesign work.