When within Class B, Class C, or the Class C outer area, the type of service being provided by a radar controller is different than the flight following you receive outside of those classes of airspace. Inside the Class B, Class C, or Class C outer area, the controller is required to provide you a certain level of separation from other traffic dependent upon your weight classification. In doing so, the controller may legally assign you altitudes that do not comply with NEODD-SWEVEN/91.159.
Outside of a Class B, Class C, or the Class C outer area, controllers provide traffic advisories on a workload-permitting basis. They also have an order to prevent collisions between aircraft, so it would not be unheard of for a controller to "assign" or suggest a heading or altitude change to prevent a collision, if he or she believes one is imminent.
In no case while talking to ATC is a pilot permitted to violate the regulations of14 CFR. In the absence of an ATC-issued altitude assignment, pilots must comply with 91.159.