If the inside of a car gets to a hot enough temperature such as 200 F or above then yes the sun and hot sun can melt the hot glue sticks.
Cars can get to a very high temperature especially when they are out in the hot weather so it could be possible for the hot sun to melt the glue sticks that are left say on the dash or just sitting in the car.
Hot glue sticks melt at around 200 F to 400 F so just having the hot glue sticks out in the sun will not usually melt the glue sticks.
But when they are sitting in a car then the hot sun that heats up the car can cause the hot glue sticks to melt.
The low temperature variety of hot glue sticks melt at around 175 F to 200 F and the higher temperature variety of hot glue sticks melt at around 400 F.