Either the boss wants to hear your opinion or they don't. You need to look at body language, tone and wording to decide. In any case, they must decide.
Disagreeing in front of other employees is especially risky... It can work in your favor sometimes, but only if it serves the boss... For example, you might be providing the boss with an opportunity to demonstrate humility over a topic which they don't pride themselves on. If the boss switches and agrees with you, can improve your image in front of other employees and the boss gets to look like they are a good listener and rational decision maker. Everyone wins.
It also rests heavily on the boss' personality. Some people always have to be right, else they hate you.