Can I use butter or margarine for frosting instead of whipping cream in cakes?
I tried frosting cake with butter and icing sugar but I did not like the outcome.
Is there something else that'd come out similar to whipped cream without using cream?
If what you're looking for is a close substitute for whipped cream frosting, that narrows the possibilities down.
Boiled frosting is made with a sugar syrup (with cream of tartar and other flavorings) which is boiled and added to whipped egg whites which set with the residual heat. It is a light and fluffy frosting which contains no fats.
Meringue style frosting is made with whipped egg whites and sugar (and other flavorings) which is then heated over a double boiler to set the egg whites. This frosting is thick and fluffy, though it will deflate over time unless baked. French style meringue frosting is supposedly left uncooked, which may change the flavors.
You might also want to look at Royal icing, made with meringue powder or egg white and powdered sugar, which does not require cooking, and will have a similar flavor profile to boiled or meringue style frosting. However, the texture is not fluffy but smooth, and it tends to be dried hard, and used for structure or decoration.
For textural purposes, you won't find a better match for whipped cream style frosting than whipped egg white based frosting.
If you're looking for flavor profile rather than texture, you might try a simple powdered sugar icing that's thinned with milk instead of water (possibly with a small amount of butter for flavor). Something like this might work well, with both butter and milk in the mix, though you can certainly tweak your proportions to your taste. Or something like this recipe which includes flour and egg white along with butter, milk and sugar for a complex frosting recipe that might be less sweet.
And, finally, you might look at marshmallow creme frosting, which includes butter, marshmallow fluff, sugar and milk, and which should be light, fluffy, and sweet. There are also variations which include actual marshmallows instead of fluff, melting them into something like a boiled icing recipe, or into a cream and sugar mix.
Other frosting recipes might not be a good match for your preferences - the recipe you didn't like, of margarine and powdered sugar, seems very similar to a buttercream frosting recipe, which is thicker, sweeter and richer than whipped cream frosting. Likewise, cream cheese frosting (similar to buttercream with butter, sugar and milk in addition to the actual cream cheese) is less sweet, but tends towards creamy, dense and smooth rather than light and fluffy. And ganache frosting, made with chocolate and cream, is flavored, denser, and requires the missing ingredient (cream) itself.
You might check out the European style buttercream frostings, though, as they are lighter, fluffier, and less sweet than the American version - both the swiss and italian are close to a mix of meringue and boiled style frosting (respectively) and buttercream. The french version, on the other hand, uses egg yolks with the sugar syrup and butter for a richer flavor.
There are dozens of different types of frosting.
Whipped cream frosting is one of them. It's made very simply by whipping heavy whipping cream until it reaches stiff peaks and then adding a tablespoon or two of sugar to help stabilize it. It is light, airy, and not particularly stable for long periods of time unless it is kept in the refrigerator.
Another very common type of icing is "buttercream" frosting. There are several different kinds of buttercream but the most simple kind is made out of butter whipped together with lots of powdered sugar and a small amount (a tablespoon or two) of liquid - either milk or even various types of alcohol if you want your icing to be boozy. It can be made with most solid fats including margarine or shortening.
Buttercream is pretty stable without being refrigerated but it will not have the same texture (it's more dense and "fatty"). It sounds like you're used to the former but you tried out the latter and you weren't happy with the results - which I understand - it is generally significantly sweeter because you're using cups of sugar instead of a few tablespoons as with whipped cream icing.
If you want to try something that's a bit in between these two products - that has the light, airy texture of whipped cream but is sweeter and doesn't use cream, you might consider trying a "seven-minute icing". It's a cooked, egg-white based icing that is similar to meringue. It's made with egg whites, sugar and cream of tartar (as a stabilizer). Done correctly, it makes lovely fluffy peaks with a shiny gloss.
There are products specifically created to imitate whipped cream. They consist of modified starch with added sugar and flavoring, sometimes also color. You mix them with cold milk and whip. The texture is the same as whipped cream, the taste is rather close.
Anything else that you try is simply another frosting - it can be tasty, but nobody would mistake it for whipped cream. It would be up to you to decide if a frosting is sufficiently "like" whipped cream or not.
Chilled, full fat coconut milk can sometimes be whipped (with sugar and the kind of stabilizers that are also used with cream); how well it works will be very dependent on the brand used and your exact method, so experimentation will be required.