When a surgeon wounds the skin by making an incision, the tanning cells, your melanocytes, are prone to produce pigment along the edges. This is particularly true for darker skin types. That is why some fresh scars are darker than the skin around them. If you get into a tanning bed and expose the wound to more tanning stimulus, it very well may result in your scar becoming hyper-pigmented (very tan).
My advice is to never get into a tanning bed, but if you are going to at least wait 6 weeks after surgery or keep your incision covered.
Lee Corbett, MD