Pimples usually dont occur due to heat. Heat may be causing you to sweat, which may aggravate existing acne, but will not cause it. Heat can also cause rashes which may look like acne.
Foods that cause flushing in the body like spices can give rise to eruptions. Avoiding such triggers and using suitable products will help.