Several years now since I trained my dog (got him at 4 yrs old) to ride on the side of the longtail and in a trailer.
Made him jump in and out of the longtail while bike standing still. Walked the bike with dog innside and gave a few treats. Not a lot of training, just to give him the picture.
Then I rode with him running next to the bike until he was fairly exhausted. Then offered him to ride. He said thank you wery much and was wery motivated. I told him he was a good dog.
After this trailer and other solutions was no problem. He loved to ride with us and knew he could rest in the trailers or on the bikes. He was a boardercollie so a really bright dog of course