Sure, but that's why someone allergic to dairy might ask their friend who prepared dinner if anything was made with butter or cheese (or yogurt or sour cream, etc.), just to double-check.
If the person cooking is uneducated enough to not know that butter and cheese come from milk, I highly doubt they're checking the box the butter comes in for an allergen listing.