I've done some decent pictures of events such as transits (when one body passes in front of another) with my iPhone. Any camera that can take long exposures can take interesting photos of the night sky.
The general problem though is that stars are small and dim. To collect enough photons you need exposures that are long enough that the star(s) that you are trying to take pictures of will move in the field of view unless you have some sort of tracking mount. To make the image big enough you'll need a telescope with enough magnification to zoom in to the level of detail you want to see.
That's a pretty deep rabbit hole. If you just want pictures of large, bright objects like the sun or lunar craters then a small tabletop telescope and an adaptor for a regular camera might do the trick. If you want detailed, full color images of small, faint nebulae then you'll need a good telescope on a nice motorized equatorial mount at least.
If you're really serious you'll probably want a dedicated CCD eyepiece connected to a computer instead of a separate camera as well, along with some star-tracking software that feeds back into the telescope mount's drive to minimize drift, and probably some other software to take a series of images from the CCD and merge them to enhance detail and color.
Yeah, it can get expensive.