People fucked eachother 500 years ago, 1000 years ago... 10,000 years ago. I am also quite sure that sometimes they also liked to fuck each other up the asshole too 10,000 years ago.
900 years ago, people were writing ribald tales about anal stuff in High-Medieval Europe. The word Fablieau comes to mind, and it dealt with a whole variety of humorous erotic texts involving the anus and other regions of the body. Before the Fabliau there existed '1001 nights' from around ~700C.E. You also have various erotic poems and stories in ancient Greek and Latin, and even an Ancient Roman writer who wrote tips on how to date women.
During the time periods that you mentioned, you are are only slightly correct. There were few if any laws against Anal sex, and whilst the clergy of the period didn't like anal sex and thought it abhorrent, the common people rarely listened to the clergy in matters of sex.
The only way in which you are correct is that fucking a 'Guy' up the asshole could potentially be deadly. It certainly could get you deported to 'Stralia, and it certainly could get you to jail.
Depending on the region and timeperiod, you certainly could be killed for fucking a 'man' up the asshole, but there were no rules against fucking a whore or your wife up the asshole. You certainly wouldn't get deported for fucking your wife up the asshole in Victorian England, where the very act of wife-selling was commonplace and it would be unlikely if you would be deported for selling off your wife to another man... But fucking a dude up the ass that one time... Nope!
So to clarify, Anal sex between two men could get you killed, deported or sent to jail, but not anal sex between a man and a woman.