For example lets say I wanted to make snapchat better by adding some extra features to it, so I would create an app that has some cool features that makes your snapchat experience better and it would run the already existing snapchat app in this app that I create which then you could use the extra features that my app has. Also if it had in app purchases or the app would cost a fee how far could this go without breaking the law. Sorry if this is confusing, hopefully I got the main point across.
Depends. There are some software that allow their code to be modified or let other parties create extensions for their app. But there are others who do not allow it. Just look at the Copyright section and read through it, that should give you your required info.