There is nothing preventing a developer from creating an OSX or iOS application that goes outside the guidelines provided they don't with to sell within the walled garden. But, if you want to sell to users using the app store, you are subject to their requirements.
This is true of OS X but not of iOS, because OS X has sideloading and iOS does not. There are exactly three ways to get an app installed on an iOS device. The first and most common is Apple's App Store. The second is being an employee of an established company that is a paying member of the iOS Developer Enterprise Program or a student of an accredited university that is a member of the iOS Developer University Program; such organizations are allowed to run their own App Stores. The third is to be a paying member of the iOS Developer Program yourself.
What would be nice is if Apple provided a separate area for this types of apps (classwork and developer portfolio apps) and leave real, useful and commercial quality apps, on the store.
In high school, classwork is done on OS X, which allows sideloading. In college, classwork is done through the iOS Developer University Program. A developer portfolio should use a combination of three methods: A. having one or more of your applications on the App Store to demonstrate that you are familiar with the skill of negotiating with Apple, B. videos, and C. demonstration on a device connected to a paid-up iOS Developer Program membership during an in-person interview.