Yes a shower drain can be connected to a toilet drain.
All your drain lines in your house that lead from your kitchen sink, bathroom sink, shower, bathtub etc all connect to your toilets drain which then leads to the main sewer line.
Sometimes your toilet drain may be further away from those drain lines but then still the drain lines will eventually connect somewhere to your main sewer line before it leaves the house.
Your other drain lines and toilet drain all eventually drains into the same main sewer line.