It appears exporting to a PSD format from GIMP is possible with layers being preserved. However, considering PSD being Adobe Photoshop's native format, is this legal? Considering how exports for native formats are not available for 3D files (e.g. .ma is not available for export from within other 3D softwares), is this sort of exporting legal?
The Photoshop file format specification is published by Adobe and available to everyone here: http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/
The preface to the specification states (emphasis mine):
This document is provided for 3rd parties to read and write the Photoshop native file format. This document does not explain how to interpret the data. This document describes the format of the data only.
So no, it is not illegal.
One can safely do this, adobe publishes the specifications of significant parts of the format for the public for compatibility reasons. Even if that was not the case EU law allows for a exception for reverse engineering of programs for data migration and compatibility.
PS: Generating a .ma file is not impossibly hard. And also allowed for example mathematica can export to ma. Even mb formats inner working is known, open source tools exist to write to ma and I do it all the time. The reason you dont see many readers and writers to ma is that getting a useful parity level that would be usable is hard as youd need to implement most of mayas nodes.