There is a gaggle of information about this on line. In general, if and how you can take a bike depends on the particular service.
For example, here are the requirements for taking a bike on certain train services in Germany:
Booking additional components: Taking a bicycle (bahn.de)
And here is a relatively recent piece about the new ICE 4 trains in Germany having space for 8 unboxed bikes:
Deutsche Bahn’s new ICE 4 High Speed Trains include Bicycle Spaces | ECF
When I was in Italy (Bassano del Grappa) for a couple of weeks in 2013 there was at least one regional service that you could simply roll you bike onto.