Yes, many experts say that eating before bed could affect your dreams, but it really depends on how much you eat before you sleep. In your case eating chocolate or peanut butter before you sleep will not affect your dreams, but if you consume a great amount of chocolate or peanut butter it could probably disturb your dreams.
It depends on the amount of food you eat before bed.