There could be different contexts in which this phrase can be used. I'll make one up here.
Consider the following context.
There are children in few African countries who go hungry everyday. They even go hungry to the point of being reduced to just one layer of skin over there body.
Now for us, it is safe to assume that most of us are not going to face this situation in our life. So what would be you reaction watching the news about this thing or seeing the pictures of these scrawny little kids.
'I can only imagine how it must be to go hungry everyday' - (Because you can't possibly understand their feelings or situation as you have never experienced them in your life.)
What else we can only imagine ?- (Things we never experienced and probably will never experience)
1. We can only imagine the aftermath of nuclear explosion.
2. We can only imagine the sufferings of Jews in world war two.
3. He was eaten alive by the crocodile. - How horrific !! - We can only imagine his agony.
4. I can only imagine how it feels like being the richest man in the world.
However if we take out the word 'only' in the above sentece then it would mean that you understand someone's concern / problem / feelings etc, because you know / understand / experienced sth yourself
Suppose if your boss severely tells off one of your collegues in a meeting room for poor performance and later that collegue comes out of the meeting room and says
Collegue - The boss really got at me in the meeting
You - yeah I can imagine.
(Here you can actually figure out whatever things the boss must said to your collegue since you have had the same experience in the past before)