Your code works as if you used ==in int?and int, it will return falseif the nullable value contains no value. So this is the same as if you were writing:
.Where(x => x.dtt_ref_no.HasValue && x.dtt_ref_no.Value == dtt_ref)
, Nullable<T>.Equals, int int? .