Can we simply rename an app if they are different versions and keep them both? For example, I have Xcode 4.4.1, and now Xcode 4.5 Golden Master (GM) version is available, but it is also called Xcode (when the .dmg is mounted as an disc image, it shows only one app (or folder), called Xcode)

I think the way is just to double click on the .dmg file, and then drag and drop that app into our Applications folder.  But since the current Xcode and Xcode 4.5GM have the same name, can the new one just be renamed and so we can have both versions on our machine?  I was worried that what if the app writes back data to the /Applications/Xcode folder, then the GM version can write unexpected data for the 4.4.1 version.

And will it work with other software, such as Xcode 3.2, Xcode 3.3, or even different versions of Microsoft Office and Adobe Photoshop?
There are several things to look at here:


Application (folder)


It's usually perfectly save to rename the application (aka the application folder) so you can easily rename the existing Xcode to /Applications/Xcode 4.4.1 and install the new version in parallel


Preferences


Typically the application saves it's preferences in a fixed location in ~/Library. So if you have two versions installed in parallel they will both read and write from the same preferences files. This may be desirable from a user point of view but will lead to problems if the format or content changed in incompatible ways.


Addons


As far as Xcode is concerned, there is additonal software installed (automatically and/or on user request) in /Applications/Xcode Utilities. If you need this, it might not be enough to simply rename this folder because you will end up with two versions of these utilities (with Xcode/OS X picking up the "wrong" version)