There are a number of different techniques you could use to achieve the result you require but the all basically involve dynamically adding a know HTML attribute (like a CSS class) to either the dialog related HTML element or one of it's parents, and then using that information to create a custom CSS selector to style it.
eg. Assuming you want the background colour of the standard Save dialog to be green whenever it is opened while viewing a Passage that has been assigned a forest tag, then placing the following CSS within your Story Stylesheet will achieve that result.
body[data-tags="forest"] #ui-dialog-body {
background-color: green;
}
note: Which method you use to add the HTML attribute (Passage tags, <<addclass>> macro, etc) and which part of the ui-dialog related HTML elements you want to change can effect the syntax and structure of the CSS selector needed.
We would need more detail about when you want the dialog styling to occur to give a more targeted answer.