While not necessarily illegal, the practice is not ecnouraged, regardless of the circumstances.
As OS X Daily points out, there’s a reason iOS 5 beta is limited to developers.
For starters, it’s buggy, which should make it painful enough if you get stuck on it without the possibility to downgrade until later this year when iOS 5 hits the mainstream. You may also lose your ability to place or receive calls.
If you have a spare device laying around, let’s just say you can satisfy your curiosity, but we still don’t recommend it.
With that out of the way, this method has been confirmed to work on iPhone 4 and iPhone 3GS.
The steps described by Erdir in order to install iOS 5 beta on a supported device are:
1. Locate and download an iOS 5 beta IPSW file from the web
2. Launch iTunes and Option-Click (Mac) or Shift-Click (PC) on the “Check for Update” button to restore the iPhone
3. Select the iOS 5 beta IPSW and proceed with its installation onto the iPhone
4. When the iPhone is done updating, you will see an activation screen. Ignore this
5. Grab the iPhone and triple click on the Home button to activate Voice Over
6. Triple click again again to bring up the Emergency Call screen
7. Tap onto Emergency Call, and while it’s switching to make the call, swipe three of your fingers down on the screen to activate the Notifications Center
8. Now inside Notification Center, tap on the Weather app to load the weather app
9. Click on the (physical) Home button to exit the app and you’ll be looking at the iOS springboard, which means you’re in! [via]