Ideally, a Scrum team should have all the needed roles to build the product within the team, and not dependent on external resources or people. So ideally, the designer and devops engineer should be part of the team even if they are not fully utilized all the sprint (although you can always have a designer handle UX/UI research to improve the product or the devops engineer spend more time automating stuff or increase monitoring for the live servers for ex to make the life of the team easier).
But as you mentioned yourself, having someone be only sometimes required or needing to be kept busy with some work to be fully utilized doesn't sit well with companies. That's because there is a prevalent way of thinking about people as resources which need to be fully used (just like you wouldn't want to have some machine just sit on the plant floor unutilized for half of the time) and think they can get the maximum benefits with 100% utilization, which is a myth in fact.
Sometimes also, someone is very skilled at their job and the company wants to have them give their input on multiple projects so that each benefits, but the end result is the same, which is introducing dependencies and possible bottlenecks.
If you are in such a situation, the team needs to plan accordingly (often having to coordinate with other teams for the same person) to make sure the dependency is minimized and bottlenecks are avoided. And that involves also the person participating to Scrum events to make sure there is still some continuity for the person, even though they work in multiple projects.
So to answer your question:
Should a designer or devops be a member of Scrum team?
Yes, they should. But often aren't.