I know some examples of cases where the development team was performing poorly which led to a bad experience with scrum. The symptom is when the development team asks for stories to refactor some code. They don't want to add any new value to the system or enable work in a different area: they've just made a rats nest out of the code or it doesn't live up to their expectations or guidelines. The cure for that? Set coding guidelines (and not just the syntax formatting variety: be hard and opinionated on initialization, patterns, and language features), mentor your team to refactor code after they've got it working and made their tests pass, and encourage developers to leave code in a better state than they found it. Also ensure that the business stakeholders and product managers are not setting unrealistic timelines and expectations. In time you'll find fewer requests to create backlog items to refactor code.
What else is there though? If your product and team leads are not concerned with security, performance, or other important factors you need to make them aware... that has less to do with scrum and more to do with good communication.