You can install it on any computer you own... Providing the System Requirements are met...
Log into App Store on your other Computer(s), being sure to use the Apple ID that Originally purchased ML...
djcastaldo is correct. Your MacBook Pro is compatible with AirPlay Mirroring, but for the iMac, you need a Mid 2011 iMac or later. See > http://support.apple.com/kb/HT5404
Also, if you don't want to download Mountain Lion twice, before installing Mountain Lion on your first computer, copy the Mountain Lion installer (stored on Applications folder) to an external disk, so you only have to connect the external disk to your other computer and install it.
You should make a Time Machine backup and/or a clone with Carbon Copy Cloner before upgrading. Check if your apps are supported > http://www.roaringapps.com
Are you looking to use AirPlay to share between your iMac and MacBook Pro? Hard to tell from your question but if this is what you are looking to do I don;t believe it is going to work.
AirPlay is for streaming to an Apple TV from your OSX or IOS devices not for going from device to device (at least that is the way I read it).
Also you need to check out if your hardwre supports AirPlay, only newer Macs will run it.
Message was edited by: Frank Caggiano - OK it will also work with newer Airport Express.