Preedit: One very solid approach to this is to buy land near the centers of interesting cities very early in the game, before they have time to grow much.
If it's too late for that: Answer:
There are three things you must do to do this:
Make sure you have a money-maker line somewhere else already!
This will be expensive.
Plant trees.
How many?
All of them.
Create bus stops and a multitude of busses ferrying passengers throughout the city,
building rep. Profit!!
Once this is in place, bulldoze a few buildings at a time, buying up land or building tracks as you go.
As an alternative, however; I would suggest the following: Build a drive-through bus station in the center of town.
Build a few drive-through bus stations and freight depots throughout town, ctrl-clicking when placing them to link them into one station. Build the rail station next to the city, ctrl-clicking to link it to the other stations in town.
Profit!!
Edit:
Some visuals for you: Here the bus station is under the station marker, and the rail station has been placed using ctrl-click, several in-game years ago, only requiring the demolishing of two or three houses.
Reedit:
Note that there are various game settings that must support this setup, such as: Stations >
Allow joining stations not directly adjacent (Must be On)
Stations
>
Max Station Spread (Must be suitably high; I run with 48) Stations >
Allow drive-through road stops on town owned roads (Must be On) Construction >
Allow removal of more town-owned roads, bridges and tunnels (Should be On)
You'll find all of this under "Advanced Settings" in the startup menu, and in-game under the settings menu.
Re-reedit:
As a third, even more expensive but far less destructive alternative; especially to start; you can build a recessed station: Blow up a couple of city blocks, enough for your stations, some basic signals, and, if necessary, track switching.
Buy up the land and dig a hole.
Dig matching holes outside of town where you want to join to your network, and build tunnels.
As your standing in town recovers, gradually bring the tunneled lines to the surface, demolishing as you go.
gaming.stackexchange.com/users/9401/Williham Totland
This is a blatant exploit
but:
Every time the city stops you taking an action, bulldoze every tree in the vicinity, and replant them all.
There is a limit to how unhappy the city can become with you from the bulldozing, and filling the city with trees from a state of having none is often enough to get you permission to bulldoze stuff.
Other than that: Build bus lines within the city.
You may need to use the above to get permissions for the stations, but bus stations are easier to place than buildings are to demolish.
Then service these.
If their ratings are sufficiently high, the city's happiness with you will go up rapidly.
Make sure you buy up the land on the planned route of your track that isn't already occupied bu houses as these bus routes will cause the city to grow, possibly creating more buildngs you need to demolish.
gaming.stackexchange.com/users/109/Macha
If you don't mind cheating you can enable the "magic bulldozer" feature ( spoiler ).
I usually enable this option just so that I can design my cities exactly as I want them.
You can then destroy houses, roads factories and anything else that you don't approve.
Note that you still will lose standing and might piss the local authority off so much that they won't let you build any new stations.
Then you have to bribe them or make sure that you already have a station so that you can rebuild your reputation.
gaming.stackexchange.com/users/8182/Arahman
I usually build a single-track station first (demolishing the minimum).
With an attached bus depot.
I then create a few more depots around the city with plenty of buses.
This allows you to build rep, demolishing a few buildings at a time (being sure to quickly build track before they get re-built).
gaming.stackexchange.com/users/9302/George Duckett
I actually think this is not possible.
To build a station in a city, you need to demolish a whole lot of things.
Alternatively, you could build something like a circle line around the city with some four or so stations and use busses to carry people from the center to your stations.
Also, apart from bribing, planting a whole boatload of trees in the city's area of influence will bring your rating up somewhat.
But I'm really talking a boatload here.
gaming.stackexchange.com/users/6446/Zsub
If you are in singleplayer,and you have AI companies other than your own,use the cheats to change companies,and use the AI company to demolish the buildings without damaging your company's reputation.
I use this method often,and it's a good one.
gaming.stackexchange.com/users/165872/Andrew
How do I keep local authorities off my back long enough to destroy and terraform part of their beautiful city so my megaconglomeration can inject its horrible, pollution-causing railway station right into its heart?  Seriously, though... how best do I add a rail station to a meaningful portion of an established city (read: not the outskirts) without appalling the local authorities?
OpenTTD: "Invading" a city to get a rail line through it
gaming.stackexchange.com
<openttd>
gaming.stackexchange.com/questions/26461
gaming.stackexchange.com/users/190/fbrereto
Plant trees and create bus stops first. Then bulldoze a few building at a time and build tracks as you go. Everytime the city stops you, bulldoze all the trees and replant them.  The favoured way is the creation of bus lines and the planting of trees to gain the sympathy of the city. 
The creation of bus stops and the planting of trees seems to work.