Well looking at the description that they used to show at the start alchemy is about understanding the structure of matter, breaking it down and rebuilding it. And looking at episode 43 when Olivier and that other guy talks about alchemy one of the rules are to not make gold, so looking at it that way it is indeed possible to create anything as long as you have the same amount of matter.

Though it doesn't seem to be exactly consistent with most of the alchemy that's being shown. If it's like that Ed shouldn't have to touch the ground to create something since he should be able to restructure the air to whatever he needs.

It could also be that each matter can only take certain routes and be reconstructed according to those routes a rough example would be inorganic matter won't be able to turn into organic matter. Another example from the first show in the exam where the a guy made paper and hydrogen from tree and water, that he had to use those matter to create paper and hydrogen. Which also explains why Ed mentioned that he's happy he kept the northern automail as it enabled him to mimic Greed, which seems like he wouldn't have been able to with his old one. It also emphasizes the understanding part, Ed didn't know what was in the northern automail so he couldn't use alchemy to destroy it, same goes for Scar. If all matter were the same and could be broken down and reconstructed to anything then it wouldn't matter what things are made of as the process would have been the same for the deconstruction.

If we go with this then the philosophers stone bypasses 2 essential rules in alchemy, the amount of material needed as well as opening all routes which is why Al was able to make new legs. Well that's my guess anyway