Yes you can put a bed inside a shed.
I have a portable shed outside in my backyard that is insulated and has electricity to it and I have it as an extra guest bedroom when family come over.
I have an 8 year old nephew and a 10 year old nephew who when they come over want to sleep in the shed as they are more comfortable in there than in my house.
I mainly installed the shed for them as I knew they were not comfortable sleeping in my house and that's okay.
I put a bed out there for them and a TV that they can watch Youtube and other shows on.
A portable shed makes for a great extra bedroom for guests and especially for kids.
insulating your shed will help keep your shed cool in the summer.
You can also add a window air conditioner to the shed to keep it cool if you're doing work in it during the summertime.
If you plan to put a bed in it to make it an additional house such as a guest house or guest bedroom for someone to sleep in then adding insulation to the shed helps keep it cool in the summer and warm in the winter.
A good natural gas heater or propane heater is good to heat up a shed in the winter and the window air conditioner or a mini split air conditioner can help keep your shed cool in the summer.
The proper insulation for your area will do wonders to keep the shed cool in the summer and warm in the winter.
Just make sure you add enough of the correct R Value insulation as if you do not then it won't work as good.